Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default submiting from form to sheet

I am trying to take information froma user form and submit it to my sheet 1
and every time a new record is entered it must go on to a new row. can anyone
help?!
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default submiting from form to sheet

Hi Darren
Place the code in the userform of the button that you will be using to add
the info

Private Sub CommandButton1_Click()
Dim nextrow As Integer
nextrow = FirstBlankRow(1, 1)

Cells(nextrow, 1) = txtEmployeeName
Cells(nextrow, 2) = txtSSN
Cells(nextrow, 3) = txtAddress
Cells(nextrow, 4) = txtCity
End Sub

Function FirstBlankRow(KeyColumn As Integer, startrow As Long) As Long
Dim i As Long

i = 0
Do While ActiveSheet.Cells(startrow + i, KeyColumn).Text < ""
i = i + 1
Loop
FirstBlankRow = startrow + i
End Function

Bob

"Darren" wrote:

I am trying to take information froma user form and submit it to my sheet 1
and every time a new record is entered it must go on to a new row. can anyone
help?!

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
Creating form on sheet 1 and having info move to sheet 2 SHARON Excel Discussion (Misc queries) 4 June 1st 09 05:01 PM
how to get a data form to fill you own exel sheet (was data-form erik van buijtenen Excel Worksheet Functions 2 May 30th 06 05:31 PM
passing a variable from sheet to form to another sheet anny Excel Programming 2 May 7th 06 11:45 PM
Copy my active sheet to a new sheet and open with an input form Brad Withrow Excel Programming 0 April 6th 06 03:56 AM
Is it possible to open the VBA form with a link in a sheet and to pass variable from a cell to the VBA form? Daniel[_14_] Excel Programming 1 August 29th 04 01:20 PM


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

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

About Us

"It's about Microsoft Excel"