Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
command button
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 -- saziz ------------------------------------------------------------------------ saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350 View this thread: http://www.excelforum.com/showthread...hreadid=562276 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
command button
Hello Saziz, Here is an example using a command button named CommandButton1. You ca change this to match your command buttons. The Range is on Sheet1, cell 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 Ros -- Leith Ros ----------------------------------------------------------------------- Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846 View this thread: http://www.excelforum.com/showthread.php?threadid=56227 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
command button add another command | Excel Discussion (Misc queries) | |||
VB's Command Button vs Form's Command Button | Excel Programming | |||
Command Button vs Form Button | Excel Programming | |||
Command Button vs Control Button | Excel Programming | |||
Command Button vs Form Button | Excel Programming |