ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copy cells to another column with VBA (https://www.excelbanter.com/excel-discussion-misc-queries/10018-copy-cells-another-column-vba.html)

Joe E via OfficeKB.com

Copy cells to another column with VBA
 
I need to write a line of code in a VBA macro for Excel that says "copy the contents of the current cell to column H in this same row." I am trying to do this as I traverse through a range of cells R (which represents a column). I have tried to use R.copy(destination), but I don't know what to use for the destination parameter to accomplish my goal. The task is simple but i'm new to Excel macro programming. Can anyone help?

--
Message posted via http://www.officekb.com

Nick Hodge

Joe

If the column is say A, you could use

r.Copy Destination:=r.Offset(0,7)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Joe E via OfficeKB.com" wrote in message
...
I need to write a line of code in a VBA macro for Excel that says "copy the
contents of the current cell to column H in this same row." I am trying to
do this as I traverse through a range of cells R (which represents a
column). I have tried to use R.copy(destination), but I don't know what to
use for the destination parameter to accomplish my goal. The task is
simple but i'm new to Excel macro programming. Can anyone help?

--
Message posted via
http://www.officekb.com




All times are GMT +1. The time now is 06:58 PM.

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