Command button code
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
|