Go to First Empty Row

K

Khalil Handal

Hi,
I have a sheet that has successive rows with data. What is the macro code so
as I can go to the first empty row? I need this so I can strt working from
that point to continue entering data
 
D

Don Guillett

going down
mc="a"
fer=cells(activecell.row,mc).end(xldown).row+1

usually better from the bottom up
mc="a"
lr=cells(rows.count,mc).end(xlup).row+1
 
K

Khalil Handal

I used the code in a maco but the active cell when running the macro didn't
move down to the first empty row! I am not familiar with this! Can you have
further instructions please?
 
G

Gord Dibben

Post the code you came up with that doesn't move down.

Either of Don's two sets of code works only on column A


Gord Dibben MS Excel MVP
 
K

Khalil Handal

My Active cell is A6.
created a mcro and posted the code and t looks as follows:

Sub godown()
mc = "a"
fer = Cells(ActiveCell.Row, mc).End(xlDown).Row + 1
End Sub

After runnig the macro the active cell remained A6. It should go down to
cell A56 which is the first empty row. I don't know what is missing???
 
D

Don Guillett

You asked for the row.
Sub godown()
mc = "a"
fer = Cells(ActiveCell.Row, mc).End(xlDown).Row + 1

'add this. However selection is rarely necessary or desirable
cells(fer,mc).select

End Sub
 
K

Khalil Handal

Thanks

Don Guillett said:
You asked for the row.
Sub godown()
mc = "a"
fer = Cells(ActiveCell.Row, mc).End(xlDown).Row + 1

'add this. However selection is rarely necessary or desirable
cells(fer,mc).select

End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
[email protected]
 
Top