Help with multi page form

HDfatboy03

Board Regular
Joined
May 23, 2010
Messages
62
Hello

I am creating a multi page form, I'm on the 2nd page and I believe it will end up being a 3 page form. The opportunity that I have is that the 1st form, the information is being transferred to a sheet named AppDB in columns 1 thru 12. The second form (a continuation of the first form) information should be transferred to columns 13 - 37 (in the same row as columns 1 thru 12). Everything is going to the correct column but the second form is starting a new row. I know the opportunity lies in this statement but I don't know how to fix it. Any suggestions.

<CODE>

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

<CODE END>

thanks in advance for any assistance

HDfatboy03
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
The bit you posted is telling it to assign iRow by finding the last row containing data in column A and offsetting down one row.
If you want your data from page 2 to start in the same row as the data from page 1 there are a few ways to determine the row of interest.
Let's assume there will (always) be the same number of rows worth of data from page 2 as from page 1.
Then you could amend the line:
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

to
iRow = ws.Cells(Rows.Count, 13) _
.End(xlUp).Offset(1, 0).Row


This will find the last row of column 13 to start laying out the data from page 2.

Hope it helps.
 

HDfatboy03

Board Regular
Joined
May 23, 2010
Messages
62
My output in the worksheet looks like this

A B C D E
2 Date Name Company Start Date Cell #
3 07/10/2010 Tom Jones Heavy Equip
4 08/01/2010 513-231-3231

And I want it to look like this

A B C D E
2 Date Name Company Start Date Cell #
3 07/10/2010 Tom Jones Heavy Equip 08/01/2010 513-231-3231

I know its something simple but I can't figure it out

Thanks

HDfatboy03
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
I'm only seeing 5 columns of data there. (Not 12 as mentioned earlier.)
If your form's first page puts the data - 07/10/2010 | Tom | Jones Heavy Equip in columns A:C, and you want the second page to start in column D the same row, then how about something like:
Code:
iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
for the first page and:
Code:
iRow = ws.Cells(Rows.Count, 3).End(xlUp).Offset(, 1).Row
for the second page.

That help?
 

Forum statistics

Threads
1,082,478
Messages
5,365,780
Members
400,849
Latest member
candy2052

Some videos you may like

This Week's Hot Topics

Top