Macro to put data in next empty cell

J

Jeane

How would I write a macro that would take me to the next
empty cell in a column. For example, I have data in C2,
C3 and C4. I want the macro copy data from A1 and put it
in C5, then I want to run the macro again and copy data
from A1 and put it in C6.
 
K

Kent

Hi

Try this code:

Sub CopyToNextEmpty()
Dim lngLastCell As Long
lngLastCell = Cells(1, 3).End(xlDown).Row + 1
Cells(1, 3).Copy Cells(lngLastCell, 3)
End Sub

Kent Schederin
 

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