Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary,
'----------------- I also need the same button to add a new row into the worksheet it is located. Can you please help me with that? '----------------- Try: '============= Private Sub CommandButton1_Click() Dim SH As Worksheet Dim Rng As Range Const sStr As String = "ABC" '<<==== CHANGE Set SH = ThisWorkbook.Sheets("Sheet2") '<<==== CHANGE Set Rng = SH.Range("A1") '<<==== CHANGE Rng.Value = sStr Me.Range("A10").EntireRow.Insert End Sub '<<============= Change the location A10 to suit. --- Regards, Norman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
command button code | Excel Discussion (Misc queries) | |||
Command button code | Excel Programming | |||
Command button code | Excel Programming | |||
VBA code behind command button | Excel Worksheet Functions | |||
Command Button VBA code | Excel Discussion (Misc queries) |