Hi Experts,
I have 10 Command Buttons in my Excel can anyone
help me the code that when I click CommandButton1 the value will be "Meal 1", CommandButton2 the value will be "Meal 2" so on and so forth...
Not necessarily clicking the buttons in sequence I could sometimes click CommandButton5 then 10, 3 or etc
I have tried the code below but I don't want to copy-paste the code to all of my button repeatedly.
is there other way to do it or a call function?
Private Sub CommandButton21_Click()
Range("M5").Select
Range(Selection, Selection).End(xlDown).Offset(0, 1).Select
Range(Selection, Selection).End(xlUp).Offset(1, 0).Value = "Meal 1"
Range(Selection, Selection).End(xlUp).Select
End Sub
____________________________----------------
Thanks in advance,
12Rev79
I have 10 Command Buttons in my Excel can anyone
help me the code that when I click CommandButton1 the value will be "Meal 1", CommandButton2 the value will be "Meal 2" so on and so forth...
Not necessarily clicking the buttons in sequence I could sometimes click CommandButton5 then 10, 3 or etc
I have tried the code below but I don't want to copy-paste the code to all of my button repeatedly.
is there other way to do it or a call function?
Private Sub CommandButton21_Click()
Range("M5").Select
Range(Selection, Selection).End(xlDown).Offset(0, 1).Select
Range(Selection, Selection).End(xlUp).Offset(1, 0).Value = "Meal 1"
Range(Selection, Selection).End(xlUp).Select
End Sub
____________________________----------------
Thanks in advance,
12Rev79