This is my first attempt at VB for excel. All I’m trying to do is write to a
cell using a form with a textbox and a command button.
I would think you would do it something like this but it’s not working.
Private Sub CommandButton1_Click()
Sheet1.Cells(A, 1) = TextBox1.Value
End Sub
Any help would be appreciated
Gus Chuchanis
RB Smissaert - 25 Nov 2007 23:18 GMT
What is A?
Try:
Sheet1.Cells(1, 1) = TextBox1.Value
RBS
> This is my first attempt at VB for excel. All I’m trying to do is write to
> a
[quoted text clipped - 6 lines]
> Any help would be appreciated
> Gus Chuchanis
OssieMac - 25 Nov 2007 23:22 GMT
Hi Gus,
When you use Cells the row/column reference is back to front to Range method
and if you use the alpha column reference then enclose it in double quotes:-
Sheet1.Cells(1, "A") = TextBox1.Value
Using numeric column reference:-
Sheet1.Cells(1, 1) = TextBox1.Value

Signature
Regards,
OssieMac
> This is my first attempt at VB for excel. All I’m trying to do is write to a
> cell using a form with a textbox and a command button.
[quoted text clipped - 5 lines]
> Any help would be appreciated
> Gus Chuchanis