K
ker_01
I'm trying to set up a macro to function on a user-selected range (rather
than hardcoding row/column references, or having a bunch of inputboxes to
collect the reference info)
Getting the range is easy;
Dim TempRange as Range
Set TempRange = Selection
debug.print TempRange.Address(False, False)
which gives me (in my test scenario): B6:AD1463
My macro will need to process each column independently, and for each
column, I will loop through each row and perform some actions.
I can use left/right/mid to pull apart B614 into the component pieces
(B..AD and 6..1463) but the code isn't elegant because I have to manually
determine where the column reference ends and the row number begins. For
example, AF2 vs A63 are the same length strings, so it requires extra logic
to pull them apart correctly.
I'm sure there is a way to directly extract the column and row information
(letting Excel figure out which characters are which), but I'm having trouble
finding the correct syntax and/or applying it to a multicell range.
I appreciate your suggestions,
Keith
than hardcoding row/column references, or having a bunch of inputboxes to
collect the reference info)
Getting the range is easy;
Dim TempRange as Range
Set TempRange = Selection
debug.print TempRange.Address(False, False)
which gives me (in my test scenario): B6:AD1463
My macro will need to process each column independently, and for each
column, I will loop through each row and perform some actions.
I can use left/right/mid to pull apart B614 into the component pieces
(B..AD and 6..1463) but the code isn't elegant because I have to manually
determine where the column reference ends and the row number begins. For
example, AF2 vs A63 are the same length strings, so it requires extra logic
to pull them apart correctly.
I'm sure there is a way to directly extract the column and row information
(letting Excel figure out which characters are which), but I'm having trouble
finding the correct syntax and/or applying it to a multicell range.
I appreciate your suggestions,
Keith