Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default using textbox for cell values

This is my first attempt at VB for excel. All Im 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 its not working.
Private Sub CommandButton1_Click()
Sheet1.Cells(A, 1) = TextBox1.Value
End Sub

Any help would be appreciated
Gus Chuchanis

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default using textbox for cell values

What is A?

Try:
Sheet1.Cells(1, 1) = TextBox1.Value

RBS

"Gus Chuch" wrote in message
...
This is my first attempt at VB for excel. All Im 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 its not working.
Private Sub CommandButton1_Click()
Sheet1.Cells(A, 1) = TextBox1.Value
End Sub

Any help would be appreciated
Gus Chuchanis


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default using textbox for cell values

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
--
Regards,

OssieMac


"Gus Chuch" wrote:

This is my first attempt at VB for excel. All Im 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 its not working.
Private Sub CommandButton1_Click()
Sheet1.Cells(A, 1) = TextBox1.Value
End Sub

Any help would be appreciated
Gus Chuchanis

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasting values from a textbox into a single cell on a spreadsheet Jordan Excel Programming 3 October 16th 07 11:46 PM
VBA- inserting multiple cell values into single textbox VBA_MAN Excel Programming 2 March 14th 06 01:42 PM
How do I add TextBox.values? WTG Excel Programming 4 February 28th 05 09:38 AM
How do I add TextBox.values? WTG Excel Discussion (Misc queries) 1 February 27th 05 08:25 PM
How do I add TextBox.values? WTG Excel Worksheet Functions 1 February 27th 05 08:22 PM


All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"