Find next blank row after criteria

P

Profairy

I'm really struggling here. I've inherited a very complicated data shee
that can not be split up in to different worksheets. I have lots o
supplier spend data listed and i've got it sorted in by supplier. Ok
so each supplier has different formulars to be applied to the data tha
is to be input. So i've inserted x number of blank rows with th
correct formulars for that supplier, beneath each supplier in the lis
and now what i need to do, is when someone comes to add a new recor
for that supplier their data will go in to the data sheet in the nex
blank space under that supplier name.

SOrry this is very long winded.

Ok so simply i some code that will let me insert data by finding th
next blank row after a specific point... i.e after a specified supplie
which will be chosed in a combobox.


1. Does anyone have a clue what i'm going on about hehhee.

2. Can anyone help me? I'm not sure where to start.

Thanks in advance,
helen :0
 
J

jeff

Hi, Helen,

paste this code as your macro. It assumes that in
cell "B1" is the starting value of the row to search.
So if B1 = 14, this will start searching for a blank
in col A14 on down.

You could add a combo box which puts the row num +1 of
the supplier name row into B1.

Hope this gets you started.
jeff


Sub cc()
startrow = Range("B1")
For Each c In Range(Cells(startrow, "a"), Cells
(ActiveCell.End(xlDown).Row, "a"))
c.Select
If c = "" Then 'looks for blank
' If UCase(c) = "X" Then << would look for an X
MsgBox "ended at " & ActiveCell.Address
' insert data here
Exit Sub
End If
If c.Row > 500 Then Exit Sub 'escape
Next
End Sub
 
P

Profairy

I'm not sure i understand...

1. the range of my data starts at A8 and i'll be looking for the nex
blank in column (f) supplier column.

2. the code in red won't run... i presume because the variables aren'
declared... ?? How would i do this>

3. what data do i insert at the insert data here? is this where i tel
it to unload the data from the form in to the table. ie in to the blan
row?


Sub cc()
startrow = Range("B1")
For Each c In Range(Cells(startrow, "a"), Cells
(ActiveCell.End(xlDown).Row, "a"))
c.Select
If c = "" Then 'looks for blank
' If UCase(c) = "X" Then << would look for an X
MsgBox "ended at " & ActiveCell.Address
' insert data here
Exit Sub
End If
If c.Row > 500 Then Exit Sub 'escape
Next
End Su
 
Top