Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default VB Form to populate spreadsheet.

Hi,

I am trying to find the best command I can use in visual
basic to do the following.
I have a user form with some textboxes and combo boxes.
txtname, txtpol, txtaddress etc.
I want a macro that when pushed will take this info and
put it into my spreasheet on row 1.
txtname = A1
txtpol = A2 etc.
But if another case is entered i need vb to populate the
next free row rather than insert the info over info
currently there.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default VB Form to populate spreadsheet.

Hello Glenn
To get the next available row:
Dim FirstEmptyRow As Long
FirstEmptyRow = Range("A65536").End(xlUp)(2).Row

HTH
Regards
Pascal

"Glenn Robertson" a écrit dans le
message de ...
Hi,

I am trying to find the best command I can use in visual
basic to do the following.
I have a user form with some textboxes and combo boxes.
txtname, txtpol, txtaddress etc.
I want a macro that when pushed will take this info and
put it into my spreasheet on row 1.
txtname = A1
txtpol = A2 etc.
But if another case is entered i need vb to populate the
next free row rather than insert the info over info
currently there.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VB Form to populate spreadsheet.

Hi Glenn,

Here is the code

Dim cLastRow As Long

cLastRow = Cells(Rows.Count, "A").End(xlUp).Row
If cLastRow = 1 And Cells(cLastRow, "A") = "" Then
Else
cLastRow = cLastRow + 1
End If
With UserForm1
Cells(cLastRow, "A").Value = txtname.Text
Cells(cLastRow + 1, "A").Value = txtpol.Text
Cells(cLastRow + 2, "A").Value = txtaddress.Text
'etc.
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Glenn Robertson" wrote in message
...
Hi,

I am trying to find the best command I can use in visual
basic to do the following.
I have a user form with some textboxes and combo boxes.
txtname, txtpol, txtaddress etc.
I want a macro that when pushed will take this info and
put it into my spreasheet on row 1.
txtname = A1
txtpol = A2 etc.
But if another case is entered i need vb to populate the
next free row rather than insert the info over info
currently there.



  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default VB Form to populate spreadsheet.

how do i tell it to populate this row
-----Original Message-----
Hello Glenn
To get the next available row:
Dim FirstEmptyRow As Long
FirstEmptyRow = Range("A65536").End(xlUp)(2).Row

HTH
Regards
Pascal

"Glenn Robertson" a

écrit dans le
message de ...
Hi,

I am trying to find the best command I can use in visual
basic to do the following.
I have a user form with some textboxes and combo boxes.
txtname, txtpol, txtaddress etc.
I want a macro that when pushed will take this info and
put it into my spreasheet on row 1.
txtname = A1
txtpol = A2 etc.
But if another case is entered i need vb to populate the
next free row rather than insert the info over info
currently there.



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VB Form to populate spreadsheet.

see my response.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wrote in message
...
how do i tell it to populate this row
-----Original Message-----
Hello Glenn
To get the next available row:
Dim FirstEmptyRow As Long
FirstEmptyRow = Range("A65536").End(xlUp)(2).Row

HTH
Regards
Pascal

"Glenn Robertson" a

écrit dans le
message de ...
Hi,

I am trying to find the best command I can use in visual
basic to do the following.
I have a user form with some textboxes and combo boxes.
txtname, txtpol, txtaddress etc.
I want a macro that when pushed will take this info and
put it into my spreasheet on row 1.
txtname = A1
txtpol = A2 etc.
But if another case is entered i need vb to populate the
next free row rather than insert the info over info
currently there.



.



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
Populate an order form with Data Les Linton Excel Worksheet Functions 0 January 16th 08 02:13 AM
populate form from where the cursor is Diana Morrison Excel Worksheet Functions 1 December 7th 07 08:57 PM
Populate a form from a sheet in same workbook Diana Morrison Excel Worksheet Functions 3 December 5th 07 07:44 PM
Populate a form Doug Excel Worksheet Functions 3 December 15th 06 03:33 PM
How to enter data in one form & populate several others w/same. cmcpsych Excel Worksheet Functions 3 October 13th 06 01:45 AM


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