![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 14
|
Hi All,
I have a worksheet in which I need to run a macro everytime the value in a cell (say Cell B1) is changed. [Note: The calculation mode in the workbook is required to stay manual] I know that I can do this using a TextBox, but I am trying to see if I can do without it to preserve the look and feel of the worksheet. Uning a text box would work for me, provided I could embed the textbox in cell B1 such that a Tab press in cell A1 could move me to the text box. I've run out of ideas on this and would really appreciate your help. Thanks! Manish |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Las Vegas Nevada USA
Posts: 240
|
Try this
Private Sub Worksheet_Change(ByVal Target As Excel.Range) ' Level 1: Set up the event to watch a single cell. If Target.Address = Range("VB_Trigger").Address Then ' Level 2: Perform some action based on the value of the watched cell. Select Case Target.Value Case 1 MsgBox "Hello" Case 2 MsgBox "Goodbye" Case 3 MsgBox "Pretty Bird" End Select End If End Sub
__________________
George Learn to listen. Opportunity sometimes knocks very softly. |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 14
|
George,
Thank you very much! That did the job! Regards, Manish |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|