I created 2 command button on user form. How can I write a code to put a set of data in a particular range if a button1 is clicked and simillarly into a different range if button2 is clicked.
Appreciate your help.
Thank you
Syed
I created 2 command button on user form. How can I write a code to put a set of data in a particular range if a button1 is clicked and simillarly into a different range if button2 is clicked.
Appreciate your help.
Thank you
Syed
Hello Saziz,
Here is an example using a command button named CommandButton1. You can change this to match your command buttons. The Range is on Sheet1, cells A1 to A3. Be sure to change these to match your code also.
Sub CommandButton1_Click()
With Worksheets("Sheet1")
.Cells(1, "A").Value = "A"
.Cells(2, "A").Value = "B"
.Cells(3, "A").Value = "C"
End With
End Sub
Sincerely,
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks