ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   copy and paste using vb code (https://www.excelbanter.com/excel-discussion-misc-queries/109246-copy-paste-using-vbulletin-code.html)

ASU

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

Dave Peterson

copy and paste using vb code
 
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.



ASU wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com