Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to pass data from UserForm to spreadsheet

Hi. Ive just been introduced to userforms. Neat! I am familiar with
vba on a beginner level. To keep it simple, I have a userform that
asks for 2 numbers to be iputed into textboxes and I want to pass
that to column 1 and 2. Is there an easy way of doing this so that
the data is sent to the next blank cell on the bottom of column or
top top of column. In the past Ive insert a row so data would be
moved down or searched out the bottom blank cell- VERY inefficient.

Thanks
Mike

Private Sub CommandButton1_Click() ' on user form
Dim b As Single
Dim a As Single
b = TextBox2.Value
a = TextBox1.Value
Cells(1, 1) = a
Cells(1, 2) = b
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to pass data from UserForm to spreadsheet

Debra Dalgleish has some notes that may help:
http://contextures.com/xlUserForm02.html

susan wrote:

Hi. Ive just been introduced to userforms. Neat! I am familiar with
vba on a beginner level. To keep it simple, I have a userform that
asks for 2 numbers to be iputed into textboxes and I want to pass
that to column 1 and 2. Is there an easy way of doing this so that
the data is sent to the next blank cell on the bottom of column or
top top of column. In the past Ive insert a row so data would be
moved down or searched out the bottom blank cell- VERY inefficient.

Thanks
Mike

Private Sub CommandButton1_Click() ' on user form
Dim b As Single
Dim a As Single
b = TextBox2.Value
a = TextBox1.Value
Cells(1, 1) = a
Cells(1, 2) = b


--

Dave Peterson
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
Pass variable from module to userform and back [email protected] Excel Programming 0 July 20th 06 04:46 PM
Pass public variable from one userform to a second... Mike Dunworth Excel Programming 2 September 4th 05 12:30 AM
Pass Data from List Boxes in Userform ExcelMonkey[_190_] Excel Programming 1 February 19th 05 10:45 PM
can a userform pass an argument? smokiibear Excel Programming 12 December 8th 04 02:14 AM
How to pass arguments from ThisWorkbook to a UserForm strataguru[_4_] Excel Programming 1 October 7th 03 11:29 PM


All times are GMT +1. The time now is 07:17 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"