I have been researching a way to make invoke a macro based on changes in a cell and came across the worksheet_change event. I think this is what I need, and while I have some programming (though, very little) in my background, I am confused about the code for this event. What I have as an example found is:
This is just an example, but I am confused if I should put something else in the parenthesis instead of "ByVal Target As Excel.Range"?
I am trying to have the event look at cell H16, see if it is empty - if not, then look at I16 and see if it is empty - if yes, then run my userform. of course, i need to look at cells in H and I for rows 16 through 45 so I am thinking a loop is needed (?).
Any suggestions would be greatly appreciated. I am a newbie at VBA and have gotten along okay until I came to this! Thanks so much! Emily
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target = 4 Then myVBMacro
End Sub
This is just an example, but I am confused if I should put something else in the parenthesis instead of "ByVal Target As Excel.Range"?
I am trying to have the event look at cell H16, see if it is empty - if not, then look at I16 and see if it is empty - if yes, then run my userform. of course, i need to look at cells in H and I for rows 16 through 45 so I am thinking a loop is needed (?).
Any suggestions would be greatly appreciated. I am a newbie at VBA and have gotten along okay until I came to this! Thanks so much! Emily