How can I select the first blank cell

V

Valdemar

Hi all,
please help. I have to add every day new data (number of rows is various) to
existing data sheet. I suppose to use macro and run that automatically at
night. As I have to add it to table where number of rows will groe up, I need
to start copying new data to the first blank cell in the first column. How
can I force macro to find this blank cell when the position will shift?
Many thanks,
Valdemar
 
R

ryguy7272

Find the end of a list:
here are a couple different ways:

this will select the cell. it's not a good practice to select, but just used
as
an illustration here.

range(worksheets("Sheet1").cells(rows.Count,"A").end(xlup).address).Select

or if you just want A5 returned:

lastcell = worksheets("Sheet1").cells(rows.Count,"A").end(xlup).address(0,0)

Find Last Used Cell:
Sub FindLastCell1()
Cells(Rows.Count, "A").End(xlUp).Select
End Sub

Sub FindLastCell2()
Range("A:A").Find("*", Cells(1), _
xlValues, xlWhole, xlByRows, xlPrevious).Select
End Sub
 
B

Bernie Deitrick

Valdemar,

ActiveSheet.Cells(Rows.Count,1).End(xlUp)(2).Select

will select the first empty cell at the bottom of column A.

HTH,
Bernie
MS Excel MVP
 
V

Valdemar

Hi ryguy7272, many thanks for you help and have a nice day
Valdemar

ryguy7272 píše:
 
V

Valdemar

Hi Bernie, many thanks for your very usefull help
Valdemar

Bernie Deitrick píše:
 

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