This could very well be the most ignorant question ever asked in the forum. But, this is the only way to learn!!
I often have to change ranges in macros because in one sheet the Data would be in column "C", in another in "F" another sheet may have in "I", "L" & "O" where I have to rune the macro three times for that page.
As it is, for the examples below, I have to change all the references to C in the macros which can be scattered in several rows across the macro. That, "C" to "F", "C2" to "F2" and so forth.
As examples of macro ranges.
ex1) For Each r In Range("C2", Range("C" & Rows.Count).End(xlUp))....
ex2) With Range("C2", Range("C" & Rows.Count).End(xlUp)).Offset(, -2).Resize(, 2)
.......iferror(left(C2,find(""."",C2)-1),"""")......
Is there a way to define in a manner, i = "C"
i2 = "C2"
For Each r In Range("i2", Range("i" & Rows.Count).End(xlUp))....
so, here we have redefined i as C, and i2 as C2. So all I have to do is just change the definition line from i = "C", "F", "I" or "L", etc as the case may be, without having to change every "i" in the macro.
I hope I at least make sense in what I need to accomplish.
Thank you very much.
I often have to change ranges in macros because in one sheet the Data would be in column "C", in another in "F" another sheet may have in "I", "L" & "O" where I have to rune the macro three times for that page.
As it is, for the examples below, I have to change all the references to C in the macros which can be scattered in several rows across the macro. That, "C" to "F", "C2" to "F2" and so forth.
As examples of macro ranges.
ex1) For Each r In Range("C2", Range("C" & Rows.Count).End(xlUp))....
ex2) With Range("C2", Range("C" & Rows.Count).End(xlUp)).Offset(, -2).Resize(, 2)
.......iferror(left(C2,find(""."",C2)-1),"""")......
Is there a way to define in a manner, i = "C"
i2 = "C2"
For Each r In Range("i2", Range("i" & Rows.Count).End(xlUp))....
so, here we have redefined i as C, and i2 as C2. So all I have to do is just change the definition line from i = "C", "F", "I" or "L", etc as the case may be, without having to change every "i" in the macro.
I hope I at least make sense in what I need to accomplish.
Thank you very much.