Hi,
I am getting this "Run-time error '1004: Method 'range' of object'_Global' failed" for the below code.Please advise.
Thanks in advance!![]()
Please Login or Register to view this content.
Hi,
I am getting this "Run-time error '1004: Method 'range' of object'_Global' failed" for the below code.Please advise.
Thanks in advance!![]()
Please Login or Register to view this content.
you've set your variable as a 'variant' data type, try range instead.
I have changed to Range but still getting same error.
Getting this error mainly this type of file "Microsoft Office Excel 97-2003 Worksheet"
Thanks!
You can not set to non VBA object.
I think LastCol is a long variable, not an object, so remove set
![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
If I remove set and put the above code,getting same error for this line:
Thanks!![]()
Please Login or Register to view this content.
What are you trying to do?
I do not like go to and will avoid using it if I can.
If I remove go to what I have to use instead?
Thanks!
Only if I knew what are you trying to do.
I am trying to select active cell to last used cell in a row.
Thank!
I do not think you can use an active cell as cells address.
![]()
Please Login or Register to view this content.
Make clear what you want the result to be.....
This one selects the active cell until the last cell in that row
![]()
Please Login or Register to view this content.
This one works too, but avoid active cell again.
![]()
Please Login or Register to view this content.
This code is working only for first row.
If I want to select any other rows it is not working.
Thanks!
Thanks for now let you know if I have any problem.
For selection of selected cell (on any row) to last cell used in the row:
![]()
Please Login or Register to view this content.
In the version of Excel you mention the columns only go up to IV.
![]()
Please Login or Register to view this content.
Last edited by Norie; 02-01-2014 at 06:03 AM.
If posting code please use code tags, see here.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks