Hi
You have made it more difficult for me because you have not explained very well what you want nor given any expected results. I will take a guess you either don’t know or have difficulty with the English language.
Probably a bit of both…
No matter. I had a try at guessing what you want
https://excelfox.com/forum/showthrea...ll=1#post15604
Assuming that I have guessed correctly, then the solution is quite easy. .. There must be a thousand ways to do it, ( and the whole thing can be done better anyway ).. But as I assume you have little idea of anything that’s going on, I will try to keep the modifications as minimum as possible to avoid confusing you further…
So…. The solution attempt
I have tried already to explain that you are basing a lot of the working on resizing and offsetting from the top left of your destination range. So you might as well Set your destination range to wkbDst.Worksheets("STATEMENT").Range("A17")
As I tried to explain in my previous posts, doing a change like that will stop you getting the error.
The remaining problem is that your column offset variable, c, goes from 0-3 ( it does 0 1 2 3 ). But you want to put the last column of data in an extra column to the right.
You want c to do like 0 1 2 _4
A very simple cure for this would be to add a check and adjustment thus:
__ If c = 3 Then Let c = 4
So there are two simple changes
_ change Set rngDst = wkbDst.Worksheets("STATEMENT").Range("A17:C17, E17") to Set rngDst = wkbDst.Worksheets("STATEMENT").Range("A17")
_ add a code line of __ If c = 3 Then Let c = 4 just after the existing code line of c = c + 1
Alan




Reply With Quote
Bookmarks