Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Macro from specific cells
Hi folks,
Tried searching the web for this, but don't know what event I'm searching for! I have a number of cells in a certain column (F9, F15, F16, F23....) Non-contiguous. After the number is entered in these cells, I want it to trigger a macro to effect the adjacent cell (bg colour and font colour) I can construct the macro and assign it to a button, but I am unsure of how to tie it to a specific cell or cells. Anyone? TIA, Piers |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Macro from specific cells
It would be much simpler to use Conditional Format on the adjacent cells.
Mike F "Piers 2k" wrote in message ... Hi folks, Tried searching the web for this, but don't know what event I'm searching for! I have a number of cells in a certain column (F9, F15, F16, F23....) Non-contiguous. After the number is entered in these cells, I want it to trigger a macro to effect the adjacent cell (bg colour and font colour) I can construct the macro and assign it to a button, but I am unsure of how to tie it to a specific cell or cells. Anyone? TIA, Piers |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Macro from specific cells
Use the Change event (not SelectionChange)
right click on the sheet tab and select view code. then, from the dropdowns at the top of the module: Left: Worksheet Right: Change Private Sub Worksheet_Change(ByVal Target As Range) if Target.count 1 then exit sub set rng = Range("F9,F15:F16,F23") if not intersect(Target,rng) is nothing then With Target.Offset(0,1) .Interior.colorIndex = 3 .Font.ColorIndex = 6 End Wtih End if End Sub See Chip Pearson's page on Events http://www.cpearson.com/excel/events.htm -- Regards, Tom Ogilvy "Piers 2k" wrote in message ... Hi folks, Tried searching the web for this, but don't know what event I'm searching for! I have a number of cells in a certain column (F9, F15, F16, F23....) Non-contiguous. After the number is entered in these cells, I want it to trigger a macro to effect the adjacent cell (bg colour and font colour) I can construct the macro and assign it to a button, but I am unsure of how to tie it to a specific cell or cells. Anyone? TIA, Piers |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Macro from specific cells
Fab - thanks Tom.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro help: moving specific cells based upon content | Excel Worksheet Functions | |||
Email Macro specific Cells? | Excel Worksheet Functions | |||
modify a macro to apply to a specific range of cells | Excel Discussion (Misc queries) | |||
Macro to copy specific cells from one workbook to another | Excel Discussion (Misc queries) | |||
How do I pause a macro to select specific cells | Excel Worksheet Functions |