Select/Case question

hallingh

Well-known Member
Joined
Sep 11, 2010
Messages
769
Hi all. I'm going to start putting together a sub using select/case today, but I have a question on it. Can you select a range bigger than one cell and then have the cases be specific to certain cells within that range? For example:

Code:
Select Case Range("A1:B4")
Case B4.value <> ""
Do This
 
Case B3.value <>""
Do This
 
etc.


I'm not really sure if this is written correctly or if you can even accomplish this using select/case. Any help or insight would be greatly appreciated. Thanks for the looks!

Hank
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You only want to select a single value in your Select/Case statements. So if you want to loop through a range a cells, create a loop outside of the Select/Case statements to loop through them.
 
Upvote 0
Thanks for the response. Is there a limit to the number of cases you can use in a select/case?
 
Upvote 0
Not that I know of. At least I have never hit it.
 
Upvote 0
OK. I am going to try and put something together today. If I can't get it to work I'll post my attempt tomorrow at some point. Thanks again for the help.

Hank
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,710
Members
452,939
Latest member
WCrawford

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