Selecting range of visible cells

poiu

Active Member
Joined
Sep 13, 2011
Messages
384
Hello,

The following bold line of code is giving the error message "select method of range class failed" (the range is made up of only visible cells). Please could you help?

Set input_data_range = Range("FY2012!F8:X83"). _
SpecialCells(xlCellTypeVisible)
input_data_range.Select

Thanks,

Poiu
 

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.
If the FY2012 sheet is not active, you can't select the cells on it. You need to activate it first.
 
Upvote 0
Just wondering why you'd want to 'select' the cells after you've defined a range - anything you'd do to a selection, such as copying, setting formats, adding text or a formula, you can do without selecting.
 
Upvote 0
Just wondering why you'd want to 'select' the cells after you've defined a range - anything you'd do to a selection, such as copying, setting formats, adding text or a formula, you can do without selecting.

Hi Weaver, I'm testing the code line by line. I just want to see visually what I think excel has set to the range (I'm still trying to wean myself off that record button!)

Thanks
 
Upvote 0
Try

Code:

Application.Goto input_data_range</PRE>

<!-- / message --><!-- sig -->__________________

Thanks VoG, worked a treat. Is it correct to say that the select method can't be used on ranges made up of lots of subranges?
 
Upvote 0
No. As Rory said, to use Select you must Activate or Select the sheet first. That isn't necessary with Application.GoTo
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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