Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8786399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:36:59+00:00 2026-06-13T21:36:59+00:00

I am trying to copy the value of multiple non-contiguous ranges into an array.

  • 0

I am trying to copy the value of multiple non-contiguous ranges into an array. I wrote code like this:

summaryTempArray = .range("A2:D9,A11:D12,A14:D15").Value

But it copies only the first part (A2:D9). Then, I tried the following and I get the error – “Method Union of Object _Global Failed” – is there any mistake in the way that I am using union?

summaryTempArray = Union(.range("A2:D9"), .range("A11:D12"), .range("A14:D15")).Value
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:37:01+00:00Added an answer on June 13, 2026 at 9:37 pm

    Don’t know what was wrong with your union, but it would have created the same range, which you stated in your first attempt.

    The problem is, you have now multiple areas. Which you can, and as far as I know, has to address now.

    Here is an example, which will resolve in an array of all areas, without adding each cell individually, but adding each area individually to the summary array:

    Public Sub demo()
      Dim summaryTempArray() As Variant
      Dim i As Long
    
      With Tabelle1
        ReDim summaryTempArray(1 To .Range("A2:D9,A11:D12,A14:D15").Areas.Count)
    
        For i = 1 To .Range("A2:D9,A11:D12,A14:D15").Areas.Count
          summaryTempArray(i) = .Range("A2:D9,A11:D12,A14:D15").Areas(i)
        Next i
      End With
    
    End Sub
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to copy an NSString value out of an NSMutableArray into a new
I am trying to copy a property by value so that different instances can
I am trying to copy the corresponding graduation_date values from the graduation_term table into
I'm trying to copy the Google image search from this page . Here is
I encounter some problem when I am trying to copy (non-duplicated) selected content from
I am trying to figure out how to copy a value I am holding
I am trying to copy camera metadata into a Bitmap, and seing as each
I'm trying to copy the values from a named range in Excel to a
I'm trying to copy and paste a range, to create a 28 by 28
I have html like this: <div> <input type=checkbox id=checkbox, checked=checked/> <label for=checkbox>Copy values</label> </div>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.