Hi,
I have set variables to identify the first row, last row, and last column. when I try to select the range it gives me an error.
Thanks![]()
Please Login or Register to view this content.
R
Hi,
I have set variables to identify the first row, last row, and last column. when I try to select the range it gives me an error.
Thanks![]()
Please Login or Register to view this content.
R
Last edited by rvc81; 12-08-2010 at 08:05 AM.
No need for variables:
maybe this will give the same result![]()
Please Login or Register to view this content.
or even![]()
Please Login or Register to view this content.
But in general you should avoid 'activate' and 'select' in VBA.![]()
Please Login or Register to view this content.
Last edited by snb; 12-08-2010 at 07:01 AM.
thank you so much for the code.
I have used the the first code, it selects the range but selects 1 extra column and 5 extra rows.
R
This will select 1 column and 1 row less:
![]()
Please Login or Register to view this content.
Last edited by snb; 12-08-2010 at 07:56 AM.
with the above code the column selection is ok but it selects 5 extra rows
Thanks
R
Can't tell without seeing your worksheet.
But most likely the last 5 cells in column A are not empty (although they give that impression). Delete those last 5 rows and try again.
I think you are right, I tried the code in a new sheet and it works perfectly fine.
Thanks again.
R
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks