How to get cell ranges based on value in the cells

matvon

New Member
Joined
Aug 23, 2016
Messages
1
I'm trying to cut down the number of variables I have for solver. I have a large group of cells that could all be changed, but have identified the ones that will actually need changed with a 1 as the value. How do I get the cell range(s) of just the cells with 1 in them?

Here is an example of what I have. The type of output in a separate cell is $A$1:$B$2;$F$1:$F$2;$E$3;$F$4;$A$5:$A$9;...etc.
ABCDEF
1
111
2111
31
41
5111
6111
71111
8111
91

<tbody>
</tbody>
Any help is appreciated!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Maybe this (change MsgBox to wherever you want the addresses to go)...

MsgBox Range("A1:F9").SpecialCells(xlConstants).Address
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,580
Members
449,089
Latest member
Motoracer88

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