View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
broro183
 
Posts: n/a
Default Macros fill cells regardless of row number


Hi Trixie,

I'm assuming you have some knowledge of using macros from the wording
of your question.

Try the below code (adapted from Bob Phillip's post,
http://www.excelforum.com/showthread.php?t=500529):

Sub CopyToFirstBlankRow()
Dim LastRow As Long
LastRow = ActiveSheet.Cells(rows.Count, "A").End(xlUp).Row
ActiveSheet.Range("A" & LastRow).EntireRow.Copy ActiveSheet.Range("A"
_
& LastRow + 1)
End Sub

fyi, Bob didn't include "activesheet." on his post but it appears that
I need it in my setup of Excel (not sure why?).

The above copies the entire row, if you only want some info copied (eg
col's A to L) try changing the copy line to something like:
ActiveSheet.Range("A" & LastRow & ":L" & LastRow).Copy _
ActiveSheet.Range("A" & LastRow + 1)

hth
Rob Brockett
NZ
Always learning & the best way to learn is to experience...


--
broro183
------------------------------------------------------------------------
broro183's Profile: http://www.excelforum.com/member.php...o&userid=30068
View this thread: http://www.excelforum.com/showthread...hreadid=524172