Free Microsoft Excel 2013 Quick Reference

Run Macro after double clicking on cell

Hi,

Please see attached excel file

Once any cell on each row, for example A2:B2 is double clicked on then the macro will copy the value in C2 and copy to D2 or if the cells A3:B3 is double clicked on then the macro will copy the value in C3 and copy to D3 and so on.

Thank you in advance for all your help.

Thanks


Is there a way to enable a macro by double-clicking a cell?

Currently, I'm running an AutoFilter macro that automatically references a second sheet when the specific cell is selected. The problem is that when a user does a search for an item (Ctrl+F), the macro will immediately initiate and refer to the other cell which confuses the user.

Ideally, I want the macro to be initiated ONLY when the user DOUBLE-CLICKS on the cell.

Here's the code that I'm using:


	VB:
	
 Range) 
    If Target.Column = 1 And Target.Row

I have written a macro that will hide/unhide tabs based on the active tab's color. The macro works perfectly, but I want to make this as user friendly as possible for some "non excel friendly" people. I dont like having a shortcut to run the macro in my quick access toolbar as it is on the opposite side of the screen as the tabs. Keyboard shortcuts are something they will need to be told and will need to remember. I am trying to create a userform, but want to make it small enough to fit in the status bar below the tabs and move depending on window size, etc. Thats a future project for me. In the meantime, what I REALLY want is to find a way to run a macro when double clicking on a tab. I have tried using the "activate" worksheet function, but it can get a little sloppy and confusing when clicking around on multiple tabs. And, if you are already on a tab, clicking it again does nothing as it is not activating it. Sorry for all the excess info, I just figured you should know the other options I was looking at and why I really would prefer double clicking a tab over anything else.

Dear all,

I would like to know how to write the codes if I want to call a sub defined
in macro when double clicking a cell on the worksheet. I know that I can add
buttons on the worksheet, but I wonder if I can do the same thing by just
double clicking a cell.

I tried to record the macro, I got the following codes:

Range("A1").Select
ActiveCell.FormulaR1C1 = ""

Can anyone advise? Thanks a lot!

Ivan

Hello,
A cell contains a link to another workbook cell. I want to go to that link by double clicking on the cell. I have disable the "allow editing directly on cell". When I double click it opens the workbook associated with the link, but it doesn’t go to the exact cell reference where the link is related. Is there a way to do this?

Hi

The following code is used to allow the user to double click on any cell in column B or D of that worksheet and peform a routine (in this case, a simple message box appears).


	VB:
	
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 
    Dim Check As Integer 
     
    Check = ActiveCell.Column 
     
    If Check = 2 Or Check = 4 Then 
        MsgBox "Found Column" 
        Exit Sub 
    End If 
     
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
My problem is that it slows down any work on that worksheet. If I select a cell or anything, the bottom left hand side of the screen says "Calculating cells" and counts from 0 to 100%.

Any idea of how I can avoid this? It is very annoying!

Cheers
Johno

Hi,

when activecell is in edit mode(double click on cell) or if you click on
formula bar, all default excel menus and commandbar buttons are disabled.

In the same way, i want to disable my customized commandbar buttons in a
customized toolbar, when user is editing or click on formula bar..i am unable
to do it?

Any help highly appreciated. it's very urgent.

please help me out. thanks in advance
_________________
Ram

Hi Guys,

Please see attached. I've got some code on Sheet 2 of the workbook that when I double click on cells in column 3 it filters in sheet 1 between the 2 dates. How can I add further columns to double click cells, for example on the sheet 2 I want to double click on cells in column 4 to filter for the number of contracts? Is that possible?

Any help would be much appreciated.

Many thanks
Harry

I am using an addin that requires double-clicking on a cell containing a function in order to run that function that retrieves data. The data is then presented in a table adjacent to the double-clicked cell. Each time the cell with the function is double-clicked, the data updates.

I would like to instead create a macro, so I can combine the action of double-clicking with some other code and assign this new macro to run from a button or key combo instead of manually having to double-click with my mouse/touchpad.

I have tried searching for a solution, and have come across and tried the following Application.DoubleClick method, but this does not seem to work for me:

  Sheet1.Activate
    ActiveSheet.Range("A4").Select
    Application.DoubleClick
For some reason, all it does is select a couple of other cells but doesn't run the function that updates the data.

I am only new to VBA programming, so any help is greatly appreciated.

TIA.

How can I make my macro to be executed when the user double-clicks on the active cell of Excel?
Thanks for any help.
aca

Hi dear experts,
Is it possible to run a macro concerning "sheet 2" by double clicking cell A1 in "sheet 1"?
Thanks for you attention.
Greetings, Bengtar

Hi

I have read several related threads but can't find the answer.

I want to trigger a macro when I select a value from a scroll down list in a cell.

Let's say A1 has a validation list of 5 numbers:

1
2
3
4
5

When I select a value from the scroll down list it will not trigger the macro to run. If I double click on the cell *after* I have selected from the drop-down list, and *then* hit enter, the macro will run.

Private Sub
Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
If Not IsEmpty(Target) Then
Macro1
End If
End If
End Sub

But that sort of defeats the point of using the scroll down list.

Any ideas would be appreciated.
Thanks

tx

btw, I have had some trouble with the search function for this board. anybody else having the same trouble?

Hi,

I have a macro that I have copied to the View Code section of the data sheet that a pivot table is based on.

I would like to have this macro write automatically to the View Code section of the new Sheet that is created, when I double click on an item within the pivot table....

Any help is much appreciated....

Is there a way to only single click on a specific cell, but have the curser appear is if you had double clicked on it. I need this function for cells E6, E6, and G6 only.

Thanks in advance.

Regards,

ep

Is there a way that I could have a user open up a spreadsheet and if they double click on the cell once it shows "ü" in wingdings, if they double-click on it again it shows "X" in Arial, double-click on it a third time it shows also in Arial "n/a". Then if they click on it a fourth time it is blank "". If someone could work that out for me it would be fantastic and I appreciate all and any help in advance. Below is the start where if you click on a cell it goes to "ü" in wingdings and click on it again and it is blank.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

TheValue = ""
If Not Intersect(Target, Range("D3:D45")) Is Nothing Then
TheValue = "ü"
End If

If Target.Count = 1 And Not TheValue = "" Then
Target.Font.Name = "Wingdings"

' Toggle between check and empty
If Target.Value = "ü" Then
Target.ClearContents
Else
Target.Value = TheValue
End If

Cancel = True
End If

End Sub

Need a VBA that will when you double click in cells o20:o23 the data in that cell will enter in k10

How do I make a macro run when I double click cell A1 on Sheet1. The macro has reference to other sheets as well. I am new to VBA. Help me please.

Hi

I have read several related threads threads but can't find the answer.

I want to trigger a macro when I select a date from a scroll down list in a cell *or* when a value in a cell calculates to a certain value.

Let's say A1 has a validation list of 5 dates:

2/1/05
2/2/05
2/3/05
2/4/05
2/5/05

When I click on the arrow and then select a date this *will* change the value of the cell, but it will not trigger the macro to run. If I double click on the cell *after* I have selected from the drop-down list, and *then* hit enter, the macro will run. But that sort of defeats the point of using the scroll down list.

Any ideas would be appreciated.
Thanks

tx

I really need help with function. I would greatly appreciate if anyone can assist me with this one.

I have a Excel spreadsheet where one of the tab I wrote a code for that worksheet.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
If Target.Address(False, False) = "C6" Then
Cancel = True
Call XYZ_View
Call ABC_Print_Area
End If
End Sub

Basically 'XYZ_View' goes like this. User will go to 'Inscructions' tab and type Commerical and go to 'B25' and type 'Comprehensive'. Now cell C6 above is "Comprehensive"

Sub XYZ_View()
Sheets("Instructions").Select
Range("B21").Select
ActiveCell.FormulaR1C1 = "Commercial"
Range("B25").Select
ActiveCell.FormulaR1C1 = "Comprehensive"
End Sub

Now, here is what I am looking to do, I would like run a macro when user click on C6. Instead of creating seperate macro "XYZ_View", I would like to run that code under Private Sub Worksheet_BeforeDoubleClick.

For Example,

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
If Target.Address(False, False) = "C6" Then
Cancel = True
Sheets("Instructions").Select
Range("B21").Select
ActiveCell.FormulaR1C1 = "Commercial"
Range("B25").Select
ActiveCell.FormulaR1C1 = "C6"
End If
End Sub

Does anyone know how to do this, please help me. I dont want to create hundreds of macro as it will slower my report.

Hi Guys,

I want double click on the C2 to C25 cells and copy the selected content and past that data in to the K2 cell in the same sheet(Sheet1).

Below mention macro is working fine but it selected only fixed cell C2 but i want if i click on C3 it's data go to K2 or if i click on C4 same action repeat here

Private Sub
Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Row = 2 And Target.Column = 3 Then
    Target.Select
    Selection.Copy
    Range("K2").Select
    ActiveSheet.Paste
End If
End Sub


I have a number of excel workbooks that feed data into a summary workbook,
they are all stored on a sharepoint site.
When i open up the summary book i can double click a cell and this will open
up the relevant workbook, however when another user tries to do the same it
opens up the edit cell option and displays the link.
Initially i thought this was because we were running different versions of
office but now this is not the case and the problem is still the same.
Is there some option box that needs checking or something?

thanks

Dear All,

I have two columns in a spreadsheet.

In cell "$D$3" is the word "Period 1".

I want to be able to do the following.

Double click on cell D3, where the word period 1 is.

VBA then looks up that period in column B, and finds the corresponding weeks for period 1 from column A.

I then want VBA to list these weeks next to the period 1 I double clicked, so in column E.

I have attached a spreadsheet as an example.

Any help would be greatly appreciated.

Thanks,

Mike

I have links between worksheets in one particular workbook. Usually if you
double click on the link, you get linked to that particular cell. However,
when I double click it only shows the formula in the cell instead of linking
to the cell. How do I fix my worksheet to allow my to link when I double
click? Thanks.

Hello...

I'm working on a macro to copy several values from a row after double clicking on any cell in that row(worksheet"plant master"). The paste target is another worksheet ("workspace").

I've pasted what I have below. I error 1004 "Activate method of range class failed" at the activate line (Cells(newentryline, 1).Activate)

I'm sure there is a much more sophisticated way to accomplish this, I'm just happy working through the entry level steps and getting this one to work. Any ideas? Thanks in advance...

Kevin

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'For selecting a plant from the plant master over to the workspace. Also prompts for a qty and adds the symbol and the qty to
'the clipboard to easily paste the plant label in autocad.

Dim PlantQty As Integer
Dim PlantData As Range
Dim PlantRow As Integer
Dim newentryline As Long
Dim finalrow As Long

PlantQty = InputBox("Please enter a plant qty:")

PlantRow = Target.Row

Range(Cells(PlantRow, 2), Cells(PlantRow, 5)).Copy

Worksheets("workspace").Activate

finalrow = Cells(Rows.Count, 1).End(xlUp).Row

newentryline = finalrow + 1

Cells(newentryline, 1).Activate

ActiveSheet.Paste
Application.CutCopyMode = False

End Sub

Hi,

When you doubleclick on the formula cell it helps us to trace the preceding data from where the data has been arrived. If the same logic is applied for the cell which contains SUMIF then it is showing "send error report". Could anyone helps to get rid of this error when I double click on the formula cell containing the SUMIF function.

Thanks & Regards
Shankar.