Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Submit User Form Contents to next available row

I have a user form designed for input of specific data, at the moment the
users use the Workbook "as a workbook, but I want the form to be used and
the data input to be submitted to the next free row on the sheet, how do I
do this?

I know there is a "form" in the Data menu - but I need to be able to have
the form open as soon as the workbook is opened and I can only do this with
a VBA form.

Does this make sense?


tia

Jonathan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Submit User Form Contents to next available row

Jonathan,

You can show the form when the workbook opens by using the
Workbook_Open event procedure. In the ThisWorkbook code module,
use the code

Private Sub Workbook_Open()
Userform1.Show
End Sub

To find the next available row, based on data in column A, use
code like

Dim Rng As Range
Set Rng = ActiveSheet.Cells(Rows.Count, "A").End(xlUp)(2, 1)

Insert your data on the row referenced by the Rng variable.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"jonathan" wrote in message
...
I have a user form designed for input of specific data, at the

moment the
users use the Workbook "as a workbook, but I want the form to

be used and
the data input to be submitted to the next free row on the

sheet, how do I
do this?

I know there is a "form" in the Data menu - but I need to be

able to have
the form open as soon as the workbook is opened and I can only

do this with
a VBA form.

Does this make sense?


tia

Jonathan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Submit User Form Contents to next available row

Thanks Chip,

I hate to sound dim - but I still can't work out how to write the data from
the form to the end of my data list, like I would in access.

Whats am I missing?

But this code has helpd me

tfm

Jonathan
"Chip Pearson" wrote in message
...
Jonathan,

You can show the form when the workbook opens by using the
Workbook_Open event procedure. In the ThisWorkbook code module,
use the code

Private Sub Workbook_Open()
Userform1.Show
End Sub

To find the next available row, based on data in column A, use
code like

Dim Rng As Range
Set Rng = ActiveSheet.Cells(Rows.Count, "A").End(xlUp)(2, 1)

Insert your data on the row referenced by the Rng variable.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"jonathan" wrote in message
...
I have a user form designed for input of specific data, at the

moment the
users use the Workbook "as a workbook, but I want the form to

be used and
the data input to be submitted to the next free row on the

sheet, how do I
do this?

I know there is a "form" in the Data menu - but I need to be

able to have
the form open as soon as the workbook is opened and I can only

do this with
a VBA form.

Does this make sense?


tia

Jonathan






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Submit User Form Contents to next available row

Chip's code gives you a range reference to the cell in column A for the row
where you will write your data. Now you must write your data a cell at a
time, possibly using offset from the referenced cell.

rng.Value = Userform1.Textbox1.Text
rng.offset(0,1).Value = Userform.Textbox2.Text
rng.offset(0,2).Value = Userform.Combobox1.Value

as an example.

--
Regards,
Tom Ogilvy

jonathan wrote in message
...
Thanks Chip,

I hate to sound dim - but I still can't work out how to write the data

from
the form to the end of my data list, like I would in access.

Whats am I missing?

But this code has helpd me

tfm

Jonathan
"Chip Pearson" wrote in message
...
Jonathan,

You can show the form when the workbook opens by using the
Workbook_Open event procedure. In the ThisWorkbook code module,
use the code

Private Sub Workbook_Open()
Userform1.Show
End Sub

To find the next available row, based on data in column A, use
code like

Dim Rng As Range
Set Rng = ActiveSheet.Cells(Rows.Count, "A").End(xlUp)(2, 1)

Insert your data on the row referenced by the Rng variable.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"jonathan" wrote in message
...
I have a user form designed for input of specific data, at the

moment the
users use the Workbook "as a workbook, but I want the form to

be used and
the data input to be submitted to the next free row on the

sheet, how do I
do this?

I know there is a "form" in the Data menu - but I need to be

able to have
the form open as soon as the workbook is opened and I can only

do this with
a VBA form.

Does this make sense?


tia

Jonathan








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
Display contents of a cell in a user form text box -- Excel 2003 VBA hiskilini Excel Discussion (Misc queries) 7 April 4th 23 10:22 AM
Macro to automatically fill and submit (in batch) an online form fromdata in a excel sheet??? Christophe[_2_] Excel Discussion (Misc queries) 0 December 20th 07 07:57 AM
saveto or Submit Form functionality in Excel MLyons10 Excel Worksheet Functions 0 March 29th 06 05:47 PM
Form with submit button Hooter Excel Worksheet Functions 0 June 8th 05 07:12 PM
I wanta infopath form to submit data to an excel databse file uCHE Excel Discussion (Misc queries) 0 April 26th 05 05:56 PM


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