ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select any row, copy data from specific columns (https://www.excelbanter.com/excel-programming/394767-select-any-row-copy-data-specific-columns.html)

TexWolf

Select any row, copy data from specific columns
 
I want to create the following funtionality:

1. Copy data from specific cells in the highlighted row.
2. Paste the data into a different worksheet.

I think I understand how to paste the data into another worksheet, but how
do I get data from specific columns into the clipboard?

Example:

1. User selects row 3.
2. User clicks the "Create Report" button.
3. Excel copies data from 3C, 3D, and 3H.
4. Excel pastes the data into Worksheet "Report."
5. User selects row 8.
6. User clicks the same button.
7. Excel copies data from 8C, 8D, and 8H, overwriting the previous data.

Steps 3 and 7 are where I'm hung up. I'm very new to programing, so any help
is appreciated...

Ron de Bruin

Select any row, copy data from specific columns
 
Try this TexWolf

Cells(ActiveCell.Row, 1).Range("C1,D1,H1").Copy Sheets("Report").Range("A1")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"TexWolf" wrote in message ...
I want to create the following funtionality:

1. Copy data from specific cells in the highlighted row.
2. Paste the data into a different worksheet.

I think I understand how to paste the data into another worksheet, but how
do I get data from specific columns into the clipboard?

Example:

1. User selects row 3.
2. User clicks the "Create Report" button.
3. Excel copies data from 3C, 3D, and 3H.
4. Excel pastes the data into Worksheet "Report."
5. User selects row 8.
6. User clicks the same button.
7. Excel copies data from 8C, 8D, and 8H, overwriting the previous data.

Steps 3 and 7 are where I'm hung up. I'm very new to programing, so any help
is appreciated...


TexWolf

Select any row, copy data from specific columns
 
Thanks Ron.

"Ron de Bruin" wrote:

Try this TexWolf

Cells(ActiveCell.Row, 1).Range("C1,D1,H1").Copy Sheets("Report").Range("A1")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"TexWolf" wrote in message ...
I want to create the following funtionality:

1. Copy data from specific cells in the highlighted row.
2. Paste the data into a different worksheet.

I think I understand how to paste the data into another worksheet, but how
do I get data from specific columns into the clipboard?

Example:

1. User selects row 3.
2. User clicks the "Create Report" button.
3. Excel copies data from 3C, 3D, and 3H.
4. Excel pastes the data into Worksheet "Report."
5. User selects row 8.
6. User clicks the same button.
7. Excel copies data from 8C, 8D, and 8H, overwriting the previous data.

Steps 3 and 7 are where I'm hung up. I'm very new to programing, so any help
is appreciated...




All times are GMT +1. The time now is 05:16 PM.

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