ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Specific Cells depending upon cursor location in Excel (https://www.excelbanter.com/excel-programming/349505-copy-specific-cells-depending-upon-cursor-location-excel.html)

Reva

Copy Specific Cells depending upon cursor location in Excel
 
I want to copy specific cells within one row to another location. I am
creating a Macro to do this, but my problem is How to tell the macro which
row to use. It will Always be the Active row but will change. I am not very
good with macros yet. I am selecting the same cells (columns 6-11) each
time and I am copying the info into Column X as X1, X2, X3.

Nigel

Copy Specific Cells depending upon cursor location in Excel
 
The active row can be identified as the selection criteria by reference to
the ActiveCell, so

ActiveCell.Row is the number of the row that is active, (BTW
ActiveCell.Column is the column number)

So to select a specific value from the active row use

Cell(ActiveCell.Row,1) ' for column 1 etc

If you wish to copy the range of cells 6 to 11 to X1 - try something
like.....

Range(Cells(ActiveCell.Row, 6), Cells(ActiveCell.Row, 11)).Copy
Destination:=Range("X1")






--
Cheers
Nigel



"REVA" wrote in message
...
I want to copy specific cells within one row to another location. I am
creating a Macro to do this, but my problem is How to tell the macro which
row to use. It will Always be the Active row but will change. I am not

very
good with macros yet. I am selecting the same cells (columns 6-11) each
time and I am copying the info into Column X as X1, X2, X3.





All times are GMT +1. The time now is 07:56 AM.

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