VBA; Select Variable Range
Solved
JB22
-
JB22 -
JB22 -
Hello,
I have a variable range from A5 to K.. that I want to select, but I can't do it;
I need help,
Thank you
Best regards
I have a variable range from A5 to K.. that I want to select, but I can't do it;
I need help,
Thank you
Best regards
4 answers
Hello,
the principle
Range(Range("A5"), Range("K65535").End(xlUp)).Select
or more technically
Range([A5], [K65535].End(xlUp)).Select
--
Cheers
Mike-31
I am responsible for what I say, not for what you understand...
the principle
Range(Range("A5"), Range("K65535").End(xlUp)).Select
or more technically
Range([A5], [K65535].End(xlUp)).Select
--
Cheers
Mike-31
I am responsible for what I say, not for what you understand...
Thank you Mike-31 for your response.
Unfortunately, that doesn't work.
I managed to select the last cell of the range using the following formula, but I couldn't go any further.
[A65536].End(3).Offset(0, 10).Select]
Best regards; JB22
22 =1922, so 99 years, I can be excused!
Unfortunately, that doesn't work.
I managed to select the last cell of the range using the following formula, but I couldn't go any further.
[A65536].End(3).Offset(0, 10).Select]
Best regards; JB22
22 =1922, so 99 years, I can be excused!
Re,
you have already set the status to resolved without having achieved satisfaction, the principle is to find the first non-empty cell by going up one column.
in your case two possibilities, directly column K with this line of code
or by offsetting the selection closer to your code
then we have a fixed selection point cell A5, just combine the two points
or starting from column A, offset to column K
A+
Mike-31
I am responsible for what I say, not for what you understand...
you have already set the status to resolved without having achieved satisfaction, the principle is to find the first non-empty cell by going up one column.
in your case two possibilities, directly column K with this line of code
[K65535].End(xlUp).Select
or by offsetting the selection closer to your code
[A65536].End(xlUp).Offset(0, 10).Select
then we have a fixed selection point cell A5, just combine the two points
Range([A5], [K65535].End(xlUp)).Select
or starting from column A, offset to column K
Range([A5], [A65536].End(xlUp).Offset(0, 10)).Select
A+
Mike-31
I am responsible for what I say, not for what you understand...