View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
hellZg8 hellZg8 is offline
external usenet poster
 
Posts: 26
Default Nextrow in another column

This is what I've come up with so far let me know if I'm going in the right
direction
hereis the code that you wrote out with my addition.
Private Sub CommandButton1_Click()
Nextrow = Application.WorksheetFunction.CountA(Range("A:A")) + 1

If Range("A1").Value = "" Then
inextrow = 1
iColumn = 1

ElseIf Range("A15").Value = "" Then
inextrow = Cells(Rows.Count, "A").End(xlUp).Row
iColumn = 1
Cells(Nextrow, 1) = TextBox1.Value

ElseIf Range("G1").Value = "" Then
inextrow = 1
iColumn = 7
Else
inextrow = Cells(Rows.Count, "G").End(xlUp).Row
iColumn = 7
End If
Cells(inextrow, iColumn).Value = TextBox1.Value




End Sub
this will go to the next cell but it alos changes the previous cell right
above it??

"hellZg8" wrote:

Thank You for your reply bob,
this works great but I need to be able to enter data into A1,A2,A3,A4 and
so on
until A15 is filled with data then go to G1.

I tried to modify a little (and I will keep trying ) but this is only
changing the active cell A1
Thanks again for your time and effort

"Bob Phillips" wrote:

If Range("A1").Value = "" Then
iNextRow = 1
iColumn = 1
ElseIf Range("A15").Value = "" Then
iNextRow = Cells(Rows.Count,"A").End(xlUp).Row
iColumn = 1
ElseIf Range("G1").Value = ""
iNextRow = 1
iColumn = 7
Else
iNextRow = Cells(Rows.Count,"G").End(xlUp).Row
iColumn = 7
End If

Cells(iNextRow, iColumn).Value = TextBox1.Value

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"hellZg8" wrote in message
...
I have an order form that has two sections for parts to be ordered

example
A: #,B:Part #,C:Description,D:Qty G:#,H:Part #,I: Description,J:Qty

each set of four columns has approximately 15 rows of data,i need to
determine the end of the first column set and enter data into the next.

once columns A1:A15 has it's data got to G1 and start entering data from a
user form.

I'm not sure if an array might work best for this or what ???

thank you in advance