ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Paste in Macro (https://www.excelbanter.com/excel-programming/298970-copy-paste-macro.html)

No Name

Copy Paste in Macro
 
How do I reduce the coding involved in this statement.
FinalRow is just an integer value. Thanks you


Range("A2:D" & FinalRow).Select
Selection.Copy
Range("E2:H" & FinalRow).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A2").Select

Melanie Breden

Copy Paste in Macro
 
How do I reduce the coding involved in this statement.
FinalRow is just an integer value. Thanks you

Range("A2:D" & FinalRow).Select
Selection.Copy
Range("E2:H" & FinalRow).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A2").Select


try this:
Range("A2:D" & FinalRow).Copy Range("E2:H" & FinalRow)

or:
Range("E2:H" & FinalRow).Value = Range("A2:D" & FinalRow).Value

--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)



All times are GMT +1. The time now is 02:25 PM.

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