Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default How do I set values from a userform

I have a userform with three controls.

I would like the entries in these controls to be placed in the next blank
row of a worksheet on the click on the ok button.

Q1, How do I find the next blank row in the list
Q2. How do I copy the values from the userform to the row found in Q1

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default How do I set values from a userform

Newbie wrote:

I have a userform with three controls.

I would like the entries in these controls to be placed in the next blank
row of a worksheet on the click on the ok button.

Q1, How do I find the next blank row in the list
Q2. How do I copy the values from the userform to the row found in Q1


Supposing the list starts in A1 of the first sheet, the three textboxs
are Textbox1, Textbox2, Textbox3 and the button is named cmdOK:

Private Sub cmdOK_Click()
Dim FirstBlankCell As Range

'Answer to Q1
Set FirstBlankCell = Sheets(1).Range("B6").End(xlDown).Offset(1, 0)

'Answer to Q2
FirstBlankCell.Offset(0,0) = Textbox1
FirstBlankCell.Offset(0,1) = Textbox2
FirstBlankCell.Offset(0,2) = Textbox3
End Sub

Regards,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.

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
Using values from macro to userform Pawan Excel Worksheet Functions 2 August 26th 08 11:58 AM
Userform Initialize & combo box values michaelberrier Excel Discussion (Misc queries) 3 June 27th 06 04:35 PM
Displaying cell values in a Userform michaelberrier Excel Discussion (Misc queries) 3 June 8th 06 05:24 PM
Userform for displaying values from a row jgmiddel Excel Discussion (Misc queries) 0 April 25th 06 09:00 PM
Userform and passing date values DTM Excel Programming 2 July 23rd 03 04:00 AM


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