how to copy & paste only the visible rows

mrpink

New Member
Joined
Sep 26, 2002
Messages
7
Hi,

Being still a vba-novice, I would appreciate it if someone could help me out.
I need a macro where a user can select 1 or more rows, copy this, and paste it in the same or another workbook. BUT, certain colums are hidden (the hidden colums vary from file to file). Thus when selecting a row the normal way, copying and pasting it, it also pastes the hidden cells. This is what I don't want. It should only paste the visible cells, not the cells from a hidden column... It would be great if this can be done by letting the user first select some rows, and then pressing short-cut command (eg. crtl + alt + c) to copy only the visible cells, selecting a cell where the result has to be placed and then pressing ctrl + alt + v to paste it.
Is this possible?
Thanks 4 your help.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I know how to find a button to put on the toolbar to select visable cells only (you could always record a macro and see what code it produces)

Goto View|Toolbars|Customise
Select the Commands tab, click on edit in the left hand box, scroll down in the right hand box and drag and drop the "Select Visable Cells Only" button onto your toolbar.

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,203,677
Messages
6,056,685
Members
444,883
Latest member
garyarubin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top