Results 1 to 19 of 19

Help Building Array

Threaded View

jkelly228 Help Building Array 04-07-2011, 04:33 PM
jkelly228 Re: Help Building Array 04-08-2011, 11:52 AM
jkelly228 Re: Help Building Array 04-08-2011, 01:24 PM
Brad4444 Re: Help Building Array 04-08-2011, 01:43 PM
jkelly228 Re: Help Building Array 04-08-2011, 01:44 PM
Brad4444 Re: Help Building Array 04-08-2011, 01:48 PM
jkelly228 Re: Help Building Array 04-08-2011, 01:53 PM
Brad4444 Re: Help Building Array 04-08-2011, 02:09 PM
Brad4444 Re: Help Building Array 04-08-2011, 02:13 PM
jkelly228 Re: Help Building Array 04-08-2011, 02:21 PM
Brad4444 Re: Help Building Array 04-08-2011, 03:04 PM
jkelly228 Re: Help Building Array 04-11-2011, 12:42 PM
jkelly228 Re: Help Building Array 04-11-2011, 04:44 PM
watersev Re: Help Building Array 04-12-2011, 03:37 AM
jkelly228 Re: Help Building Array 04-12-2011, 12:30 PM
watersev Re: Help Building Array 04-13-2011, 09:35 AM
jkelly228 Re: Help Building Array 04-13-2011, 02:14 PM
watersev Re: Help Building Array 04-13-2011, 05:32 PM
jkelly228 Re: Help Building Array 04-14-2011, 01:49 PM
  1. #1
    Forum Contributor
    Join Date
    01-04-2011
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2003
    Posts
    129

    Help Building Array

    Hello All,

    This goes hand in hand with the thread located here, but it is only a small portion of it. Trying to build an array of Sheet 1 Column A & B and Sheet 3 Column A & B, then compare and where they match move the values from Sheet 3 to Sheet 1.

    This is the code that I have so far, and I have never used variables before.

    Sub Date_Range()
    
        Sheet3.Select
        Dim ItemLookup3        As Long
        ItemLookup = Cells.Find(What:="*", _
        SearchDirection:=xlPrevious, _
        SearchOrder:=xlByRows).Row
        
        Sheet1.Select
        Dim ItemLookup1        As Long
        ItemLookup = Cells.Find(What:="*", _
        SearchDirection:=xlPrevious, _
        SearchOrder:=xlByRows).Row
        
        Dim MyArr3 As Variant
        Dim MyArr1 As Variant
    
        With Sheets(3): Set MyArr3 = .Range(.[a2], .Cells(Rows.Count, "a").End(xlUp)): End With
        With Sheets(1): Set MyArr1 = .Range(.[a2], .Cells(Rows.Count, "a").End(xlUp)): End With: i = 1
    
        Sheet3.Select
        Dim LoopColumn As Long
        Dim LoopColumn2 As Long
        For LoopColumn = 2000 To 2 Step -1
            If "MyArr3" = "MyArr1" Then
                Range(Cells(LoopColumn, 3), Cells(LoopColumn, 11)).Copy
                Sheet1.Select
                Cells(, 1) = "MyArr1"
                Range(Cells(, 4)).PasteSpecial Paste:=xlPasteValues
            End If
        Next LoopColumn
    
    End Sub
    Last edited by jkelly228; 04-14-2011 at 01:50 PM.

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