View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Denys Denys is offline
external usenet poster
 
Posts: 6
Default Find Next Empty Row

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
-----Original Message-----

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 procedu
Nextrow = _
Application.WorksheetFunction.CountA(Range("A:A")) + 2
Cells(Nextrow, 1) = txtfast.Text

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

*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.