+ Reply to Thread
Results 1 to 2 of 2

Help depurate this macro with Array in other worksheet range.

Hybrid View

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    99

    Help depurate this macro with Array in other worksheet range.

    Good Day !!
    I need your Help!

    I have this macro, but I need to in for example array 14, a other range (A36:H400) how it's the instrucction?
    example: x(i, 14) = arr("A36:H400")??


    Thanks a lot!!
    Option Explicit
    Dim arr
    
    Sub GetValueertert()
    Dim f$, ReCal&, pth$, x(), i&
    With Application
        ReCal = .Calculation: .ScreenUpdating = False
        .Calculation = xlManual: .DisplayAlerts = False
    End With
    
    arr = Empty: ReDim x(1 To 1000, 1 To 14)
    pth = ThisWorkbook.Path & "\": f = Dir(pth & "*.xls*", vbNormal)
    With Sheets("ACO")
        Do While f <> ""
            If f <> ThisWorkbook.Name And f <> "~$" & ThisWorkbook.Name Then
                .Range("A1").Formula = "=ToArray('" & pth & "[" & f & "]ACI'!A36:H400)"
                i = i + 1
                x(i, 1) = arr(1, 1): x(i, 2) = arr(1, 2)    'GetData FName, "ACI", "B6:C6", Sheets("ACO").Range("D2")
                x(i, 3) = arr(2, 1)    'GetData FName, "ACI", "B7:B7", Sheets("ACO").Range("F2")
                x(i, 4) = arr(3, 1)    'GetData FName, "ACI", "B8:B8", Sheets("ACO").Range("G2")
                x(i, 5) = arr(3, 2)    'GetData FName, "ACI", "C8:C8", Sheets("ACO").Range("H2")
                x(i, 6) = arr(3, 4)    'GetData FName, "ACI", "E8:E8", Sheets("ACO").Range("I2")
                x(i, 7) = arr(3, 6)    'GetData FName, "ACI", "G8:G8", Sheets("ACO").Range("J2")
                x(i, 8) = arr(5, 1)    'GetData FName, "ACI", "B10:B10", Sheets("ACO").Range("K2")
                x(i, 9) = arr(6, 1)    'GetData FName, "ACI", "B11:B11", Sheets("ACO").Range("L2")
                x(i, 10) = arr(15, 1)    'GetData FName, "ACI", "B20:B20", Sheets("ACO").Range("M2")
                x(i, 11) = arr(19, 4)    'GetData FName, "ACI", "E24:E24", Sheets("ACO").Range("N2")
                x(i, 12) = arr(16, 1)    'GetData FName, "ACI", "B21:B21", Sheets("ACO").Range("O2")
                x(i, 13) = arr(12, 1)    'GetData FName, "ACI", "B17:B17", Sheets("ACO").Range("P2")
                x(i, 14) = arr(36, 3)    ' I need the range "A36:H400", but indicate me the error ... :(        End If
            f = Dir()
        Loop
        .Range("D2:P2").Resize(i).Value = x()
        .Range("A1").Formula = Empty
    End With
    With Application
        .Calculation = ReCal: .ScreenUpdating = True: .DisplayAlerts = True
    End With
    End Sub
    
    Private Function ToArray(ExternalDataLink)
        arr = ExternalDataLink
    End Function
    [/QUOTE]

    Best Regards!

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Help depurate this macro with Array in other worksheet range.

    Hi, Federico!
    Can you attach a sample file and your desired results?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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