Dynamic arrays

RET79

Well-known Member
Joined
Mar 19, 2002
Messages
526
My macro used this before to be a dynamic array


Range([B1], [B1].End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Now, I have 3 columns now like this col(A:C)

CellRef Row Col
B2 2 2
B4 4 2

But now, instead of these being numbers, they are forumlas. For instance, the forumlas in column B are of the form:

=IF(A2="","",CELL("col",INDIRECT(A2)))

in B2 and similarly

=IF(A6="","",CELL("row",INDIRECT(A6)))

in C2.

Now, the problem is that the dynamic range now INCLUDES the cells which contain formulas, which is very annoying. Is there a way of setting the dynamic array so that it only picks up the cells in the column which has a value?

Thanks.
This message was edited by RET79 on 2002-03-26 19:22
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi. I'm not sure but please try this.

Sub test()
Dim rngConstants As Range
Set rngConstants = Columns(2).Resize(, 2).SpecialCells(xlCellTypeConstants)
rngConstants.Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,924
Members
448,533
Latest member
thietbibeboiwasaco

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