New to Visual Basic
First, remove the private from your macro, since you want to call it out via
a button (I assume).
Also, "Cells.Value("A1") = sName" is not valid. Change it to:
Cells(1,1).Value = sName
Using the Forms toolbar (NOT control), create a button. Then assign your
macro to the button.
--
Best Regards,
Luke M
*Remember to click "yes" if this post helped you!*
"Need help with sumif" wrote:
I wrote this simple task can anyone tell me how do I run this
Private Sub CommandButton1_Click()
Dim sName As String
sName = InputBox("Enter your name", "Title")
Cells.Value("A1") = sName
End Sub
|