Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert range string to integer?

5 views
Skip to first unread message

mob....@gmail.com

unread,
Nov 8, 2022, 2:22:45 AM11/8/22
to
I have range strings that indicate a vertical range on my sheet.
For example, "A1:A5".

Is there a way to convert this into integer values that indicate Column 1, Rows 1 to 5? I'd to have a For-loop iterate through rows 1 to 5, column 1, and extract the data.

Please note, not all of my range strings are as easy as "A1:A5" I might have ranges such as "AG100:AG125", etc.

Thanks!

Auric__

unread,
Nov 8, 2022, 8:08:34 PM11/8/22
to
Dim cel As Range
For Each cel In Range("A1:A5")
Debug.Print cel.Row, cel.Column
'if you're operating on every cell in the selection, you can do that here
'without needing the actual address -- for example:
cel.Font.Bold = CBool(Int(Rnd * 2))
Next

--
A name is a cloak of letters thrown upon a man. It means nothing.
0 new messages