Find Next Empty Row

M

Myrna Rodriguez

Hello VB fiens...

How can I bypass an empty cell in a row when trying to
add a row?
Scenario: I created a userform to input data into excel worksheet. Data
will be added...nextrow..nextrow..
One row may contain 2 empty fields resulting empty field
to be next row to append.

this is sample code for procedure:
Nextrow = _
Application.WorksheetFunction.CountA(Range("A:A")) + 2
Cells(Nextrow, 1) = txtfast.Text

thanks in advance for your help & enjoy life!!
myrna
 
D

Denys

Hi Myrna,

Here's an example of what I use....

Private Sub CommandButton1_Click() ' assuming it's the OK
button on the userform

With ActiveSheet()
'This macro gets the first empty cell in the active sheet.
[A65536].Select
Selection.End(xlUp)(2).Select
ActiveCell.Value = Date
ActiveCell.Offset(0, 1).Value = ComboBox2.Value
ActiveCell.Offset(0, 2).Value = ComboBox3.Value
etc....

Just make sure there'a always something to be entered in
the Column A. Personnally, I always enter todays's date.
But you may want to enter an X in the cell, and hide the
column...

I hope this helps...

Bonne journée

Denys
 
M

Myrna Rodriguez

thanks Danys for your help!

Still having a problem validating empty cell to add
next row.

When I run OK button, I need to be able to add row even if empty cells
exist in previous row.

For Example:

col A B C
row
1 red blue green
2 red blue
3

If C2 is empty, I need to skip over empty cell and go
to next row 3.

any suggestions?? thanks
 
S

sirius

I have almost the same problem.

I attached a picture because I'm not very good at explaining.

The problem is that how can i find first empty row in worksheet an
after it has been found insert left and right borders. That 18th ro
has been added automatically by sum'ing column G.

Eventually it should be something like this:
X A B C G
17 |content| content | and so on |
18 |first empty row | empty | sum of column G |

The main thing is that to get borders on first empty row.

I'm pretty sure that U woun't understand but I hope that u can :
:rolleyes

Attachment filename: excel.jpg
Download attachment: http://www.excelforum.com/attachment.php?postid=57103
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top