copy and paste using vb code

G

Guest

Please help me!!!
How do I paste, using vb code, a cells formula to the next empty cell in the
same column?
Thank you.
 
D

Dave Peterson

Dim myCell as range
dim DestCell as range

set mycell = range("somecellthatyouwanttocopy")

with worksheets("sheet9999")
set destcell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with

mycell.copy
destcell.pastespecial paste:=xlpasteformulas

=====
Something like this actually pastes to the cell under the last used cell in the
column.
 

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