Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message to Tom Ogilvy regarding SelectionChange
Tom,
Thanks again for the help with the SelectionChange code. One more follow up question if I may. Is this code legal: ----start code------- Private Sub Worksheet_Change(ByVal Target As Excel.Range) if Target.Column = 1 then if Target.Value < Target.offset(0,1).Value then msgbox "Column 1" end if end if if Target.Column = 5 then if Target.Value < Target.offset(0,1).Value then msgbox "Column 5" end if end if End sub -----end code----- I have tried this, and only the first "if Target.Column = " statement seems to be recognized. If I run it this way, only targets in column 1 work. If I switch it around, then only targets in column 5 work. And I am not allowed to do more than one "Private Sub Worksheet_Change(ByVal Target As Excel.Range)" statement (I tried this and it told me ambiguous statement). What am I doing wrong? Thanks. Doug |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message to Tom Ogilvy regarding SelectionChange
Never mind. It now appears to be working fine. Go figure
Doug |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message to Tom Ogilvy regarding SelectionChange
Yes, it is legal. Since it is the change event, it only fires when you edit
a cell - not just select it as was the case when you used selectionChange. But based on your description, Change sounded like the more appropriate event. -- Regards, Tom Ogilvy Doug wrote in message ... Never mind. It now appears to be working fine. Go figure. Doug |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Tom Ogilvy | Excel Worksheet Functions | |||
Thank You Tom Ogilvy | Excel Worksheet Functions | |||
Tom Ogilvy:Object Error Still | Excel Programming | |||
to Tom Ogilvy: re Macros in excel | Excel Programming | |||
SelectionChange code always available | Excel Programming |