Hello,
I have this VBA Code, its should find and paste some stuff.
But when something starts with 0 its not copying that with 0.
For example there is cell 00H57 it only copy H57.
Any advise?
Please Login or Register to view this content.
Hello,
I have this VBA Code, its should find and paste some stuff.
But when something starts with 0 its not copying that with 0.
For example there is cell 00H57 it only copy H57.
Any advise?
Please Login or Register to view this content.
Last edited by MartinV10; 08-16-2019 at 03:52 AM.
Change this linetoPlease Login or Register to view this content.
Or convert the target column format to text and then use paste special valuesPlease Login or Register to view this content.
Click the * to say thanks.
(removed as too late)
@PaulM100
I changed the code and its writing object required.
And converting format to text in final destination is not working.(there should be problem in copying somewhere?)
@Marc L Sorry?:D
Change "sheet1" to "match", as I forgot to do it.
@PaulM100 its still writing object required and debugger shows mistake in this:
newWrkbk.Sheets("match").Range("B:F").pastespecial xlPasteValuesAndNumberFormats
Cause you are selecting a range of columns. DO you want it pasted in a specific cell like B2? Or in the next empty row? OR?
Change "newWrkbk" to "DestWbk"
Good point @Barieq
@PaulM100 @Barieq Would you believe me that its doesnt work still?:D Its copying already like it should but there are no 0 yet.
I didn´t tell you one thing and that is that we are importing things from HTML.(protocol) if this change something?
As always it's difficult to imagine without any attachment !
@Marc L yeah obv. But not every file I can post to internet. I know its hard to find solution. But I post whole macro, where is problem. Sorry
Try adding this line:
Please Login or Register to view this content.
@PaulM1OO you mean add to basic version?
Or your upgrade + this???
That line will convert the destination range to text and since you have a mix of numbers is letters is safe to do it, as it won't affect any numbers calculation. add this to that piece of code provided before
@PaulM100 Screw it man, still nothing.
Code looks now like this. If I paste something wrong, I dont know. Iam quite dead:D Looking for this whole day. Thanks for your patiance.
Please Login or Register to view this content.
I am running out of ideas. Change the format toIt should change the number formattingPlease Login or Register to view this content.
@PaulM100 not working :D F..k it, Thanks for your time. I will be trying that anyway. Thanks for your help.
Thread marked unsolved: the OP has further queries on this issue (duplicate thread closed - please continue here in THIS thread).
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
MartinV10 - please post the follow on HTML question here. Thanks.
@PaulM100 Was doing that today, and your way with numberformat "0000" is working. Thank you very much. Final working code looks like this.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks