Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Run Macro from specific cells

Fab - thanks Tom.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro help: moving specific cells based upon content Scheetsky Excel Worksheet Functions 7 September 4th 09 02:59 PM
Email Macro specific Cells? neilcarden Excel Worksheet Functions 1 June 12th 07 07:31 PM
modify a macro to apply to a specific range of cells Dave F Excel Discussion (Misc queries) 2 April 25th 07 03:00 AM
Macro to copy specific cells from one workbook to another [email protected] Excel Discussion (Misc queries) 4 June 9th 06 04:32 PM
How do I pause a macro to select specific cells lee Excel Worksheet Functions 1 April 2nd 05 02:11 PM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"