Copy and paste first 48 visible cells

jordanl

New Member
Joined
Jan 25, 2013
Messages
7
Hi!
I have a set of data that I filter and then divide into groups of 48 using vba. What I'm having trouble with is selecting the first 48 visible cells. I've tried using offset, but that just seems to select 48 cells regardless of whether they are visible or not. ie. I start on cell A1 and want to select the first 48 visible cells. The filter has hidden cells so that Cells A1 - A42 are visible, cells A43-A1200 are hidden and cells A1201-A1211 are visible. I want to be able to select cells A1-A42 and A1201-A1211 as one selection. If I use ActiveCell.Offset(47, 0), it only selects the first 42 cells.
Any help is greatly appreciated!!!!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try using
Code:
Range("A1:A1211").SpecialCells(xlCellTypeVisible).Select
 
Upvote 0
Thanks for the response mumps, but that was just an example range. This macro needs to work on any worksheet, so absolute references won't work. Additionally, it would be way to much work to find what cell turns out to be the 48th visible cell in a given filtered range everytime I run the macro.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

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