Results 1 to 10 of 11

Thread: Run-time error 1004 when trying to resize a multi area range object

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    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
    Attached Files Attached Files
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Excel VBA Run-time error '13' Type mismatch
    By mackypogi in forum Excel Help
    Replies: 5
    Last Post: 09-17-2013, 11:16 AM
  2. Replies: 1
    Last Post: 06-18-2013, 07:46 AM
  3. Run Time error '9': Subscript out of range
    By antonio in forum Excel Help
    Replies: 4
    Last Post: 03-26-2013, 01:53 AM
  4. Replies: 4
    Last Post: 05-03-2012, 10:28 AM
  5. Spreading a time range (shift time, etc) in columns.
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 1
    Last Post: 08-23-2011, 11:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •