close

I have a macro that summaries data on sheet1, I then want it to append
this data in the form of a new row to the bottom of sheet2.

Is there a formula that I can use to locate the next blank row, or what
is the best way to achieve this please.Maybe you could just copy and paste that row in your macro.

Option Explicit
sub testme()
dim DestCell as range
dim RngToCopy as range
'your code to get the summaries

'whatever row holds the
set rngtocopy = worksheets(quot;sheet1quot;).range(quot;a999quot;).entirerow

with worksheets(quot;sheet2quot;)
set destcell = .cells(.rows.count,quot;Aquot;).end(xlup).offset(1,0)
end with

rngtocopy.copy _
destination:=destcell

'or
rngtocopy.copy
destcell.pastespecial paste:=xlpastevalues

end sub

I used column A of sheet2 to find the next available row.
Box666 wrote:
gt;
gt; I have a macro that summaries data on sheet1, I then want it to append
gt; this data in the form of a new row to the bottom of sheet2.
gt;
gt; Is there a formula that I can use to locate the next blank row, or what
gt; is the best way to achieve this please.

--

Dave Peterson

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()