macro question

D

Dean

I have a macro that cuts and pastes info to another
column. I want to make it so that whenever i do this it
pastes the data in the next empty cell, right now it
overwrites. How do i make it "look" for next empty cell?
here is what i have

Sub Macro1()
'
' Macro1 Macro

'
' Keyboard Shortcut: Ctrl+d
'
Columns("A:A").Select
Selection.Cut
Columns("M:M").Select
ActiveSheet.Paste
ActiveWorkbook.Save
Application.Run Range("AUTOSAVE.XLA!mcs02.OnTime")
End Sub

Thanks
Dean
 
T

Tom Ogilvy

You mean the next empty column
Sub Macro1()
'
' Macro1 Macro

'
' Keyboard Shortcut: Ctrl+d
'
Dim i as Long
Columns("A:A").Select
Selection.Cut
i = 0
do while application.CountA(Columns("M:M").offset(0,i)) > 0
i = i + 1
Loop
Columns("M:M").offset(0,i).Select
ActiveSheet.Paste
ActiveWorkbook.Save
Application.Run Range("AUTOSAVE.XLA!mcs02.OnTime")
End Sub
 
Top