+ Reply to Thread
Results 1 to 4 of 4

Adding multi dimensional array/range in VBA.

  1. #1
    Registered User
    Join Date
    01-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Exclamation Adding multi dimensional array/range in VBA.

    Hi Guys,

    Here is my problem statement:

    Suppose there are 2 multi-dimensional arrays in excel:

    array 1: say range 1
    a b
    c d

    array 2: say range 2
    p q
    r s

    I can perform an addition of these 2 arrays using: {(range1) + (range2)} in excel to get the desired result...

    But, the problem arises when I try and perform a similar thing in VBA. Although, using the "for" loops I can perform the said addition, but if I use a formula like:
    Please Login or Register  to view this content.
    It gives me an error. Is there an expert who can help me with this...I have to repeat this process across 20-25 worksheets and hence the complier will take a long time if I use the "for" loop method....

    I want to know if we can perform range additions in VBA which would consume lesser time??

    I hope the experts here will help me on this!!
    Last edited by romperstomper; 01-10-2011 at 09:37 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Adding multi dimensional array/range in VBA.

    please always encase VBA within CODE tags - even single line commands - I've edited your post for you on this occasion.

    Perhaps...

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 01-10-2011 at 09:34 AM. Reason: removed ISNUMBER test pointless without testing additional range

  3. #3
    Registered User
    Join Date
    01-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Adding multi dimensional array/range in VBA.

    Thanks a ton problem soved!!
    Your nick should be: "smartfox" instead of "donkeyote"

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Adding multi dimensional array/range in VBA.

    If the ranges are in the same sheet:

    Please Login or Register  to view this content.



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1