Hi,
I have the following code to select a2 and go down:
I would like to do one more cell down after that?Please Login or Register to view this content.
What do I have to add?
Many Thanks
greekboyuk
Hi,
I have the following code to select a2 and go down:
I would like to do one more cell down after that?Please Login or Register to view this content.
What do I have to add?
Many Thanks
greekboyuk
Range("A2").Select
Selection.End(xlDown).Offset(1, 0).Select
Mayweed
Please use code tags.
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
But ...
Just taking Mayweed's answer a stage further we can avoid the use of unnecessary "Selects", which slows down execution, thus :
HTHPlease Login or Register to view this content.
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
Ooops! Sorry about that.
Thanks Dominic, that's great. Mayweed, thanks as well. Is there a way to use similar concept when copying the data. For example I would like to copy data from A2:W2 and all the way down. If there are two or more rows filled with data it is fine as it copies only the data, however if only row2 contains data, it copies 65000cells?
How could I prevent this please?
Many Thanks for your contributions much appreciated
Regards
greekboyuk
This perhaps?
Please Login or Register to view this content.
]Hi Stephen,
Thank you for your help. I have created the following code:
Please Login or Register to view this content.
Now if test sheet is blank it copies my column headers. How could we prevent this please? If there is no data simply do not bring it back, go to next workbook?
Many Thanks
Not tested but see if this works. You may have to change the sheet names.
Please Login or Register to view this content.
Hi stephen
thank you again for your help. For some reasons now it highlight the Used ranged line.
Sub stops.Please Login or Register to view this content.
why this is happening??
Many thanks
greekboyuk
What happens? Does it error? If you only have one row of data there is nothing to do.
Two files attached... might help?
Hi mayweed,
Thank you for your help,
I tested your attachments and they dont function the way that I wanted them. I would like the first row of the test data not to be copied.
Also, when test workbook is empty (ignore row1) then the msg is displayed which is great however the test workbook stays open and it doesn't close.
Any ideas please?
Many Thanks
greekboyuk
Try the attached files.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks