Re: Make a macro run when data entered in a cell -multiple event [Solved/Closed]

tosinsog 1 Posts Thursday May 23, 2013Registration date May 23, 2013 Last seen - May 23, 2013 at 06:23 PM - Latest reply: TrowaD 2396 Posts Sunday September 12, 2010Registration dateContributorStatus July 19, 2018 Last seen
- May 27, 2013 at 10:57 AM
Hello,
I have three macros in the module and I want each macro to runs when the user changes the values in the cell (Cell F2) to "first", "second", "third". Cell F2 is a data drop down and it contains a 1: a blank, 2: the word "first", 3: the word "second", 4: the word "third". when the Cell is blank nothing happens, but when it is first or second or third it copy and paste into other cells respectively. I can do it for one event only but I want to be able to do it if the values are involved.
pls, help
thank you
See more 

1 reply

TrowaD 2396 Posts Sunday September 12, 2010Registration dateContributorStatus July 19, 2018 Last seen - May 27, 2013 at 10:57 AM
0
Thank you
Hi Tosinsog,

Paste the following code in the correct sheet (in Visual Basic):

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("F2")) Is Nothing Then Exit Sub
If Range("F2").Value = "First" Then Call First
If Range("F2").Value = "Second" Then Call Second
If Range("F2").Value = "Third" Then Call Third
End Sub

I assumed you called your Events First, Second and Third.

Best regards,
Trowa