Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You add a button to the worksheet and call it CommandButton1. Then you click
it. -- __________________________________ HTH Bob "Need help with sumif" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
A couple of syntax errors. This type of button is from the 'Control' toolbox so with the syntax corrected simply click the button. the button must be out of design mode. Click the icon that looks like a set-square to exit design mode. Private Sub CommandButton1_Click() Dim sName As String sName = InputBox("Enter your name", "Title") Range("A1").Value = sName End Sub Mike "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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic | Excel Discussion (Misc queries) | |||
In visual basic | Excel Worksheet Functions | |||
visual basic | Excel Discussion (Misc queries) | |||
changing the visual basic in office 2003 to visual studio net | Excel Discussion (Misc queries) | |||
Visual Basic | Excel Discussion (Misc queries) |