VBA: Range with variable references.
Solved
Antoine
-
MIKE59 -
MIKE59 -
Hello everyone,
I'm having trouble finding a way to use the Range function with variables for rows and columns on the forum. Let me explain:
I have Range("A40:A500") in my code, and I want to replace A40 and A500 with variables that I've defined earlier.
Let's say my previously defined variables are ColL and LigneL, I want to replace Range(A40:A500) with something like:
Range(ColL & LigneL ":" ColL & 500) I’ve tried this in every possible way and different manners but I can’t get it to work!
Thanks in advance for your help!!
Antoine
Configuration: Windows XP / Internet Explorer 6.0
I'm having trouble finding a way to use the Range function with variables for rows and columns on the forum. Let me explain:
I have Range("A40:A500") in my code, and I want to replace A40 and A500 with variables that I've defined earlier.
Let's say my previously defined variables are ColL and LigneL, I want to replace Range(A40:A500) with something like:
Range(ColL & LigneL ":" ColL & 500) I’ve tried this in every possible way and different manners but I can’t get it to work!
Thanks in advance for your help!!
Antoine
Configuration: Windows XP / Internet Explorer 6.0
A question on the same topic:
If
l1= Evolves every month
c2= Evolves every month
l2= Evolves every month
c2= Evolves every month
How can we do it without forcing the user to provide an inputBox?
Thanks, that's great...
I haven't seen any Microsoft documentation stating that we can mix the range method with cells(...)...
Excellent. I have my answer...
Mike