using textbox for cell values

G

Gus Chuch

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
 
O

OssieMac

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top