+ Reply to Thread
Results 1 to 3 of 3

Thread: Multiple Workbook Range Referencing?

  1. #1
    Registered User
    Join Date
    08-19-2011
    Location
    Washington, DC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Multiple Workbook Range Referencing?

    Hi all,

    Fairly simply question that I just can't figure out. I have 2 workbooks. I need to copy a specific block (3x8) into the other workbook using only 1 column (1x24). Currently, my function will work its way through the 3x8 block of values fine, and will set one cell in the 1x24 workbook with those values as it goes through. However, I can't get the location on the 1x24 workbook to move down to the next desired cell. I've been trying to use range and set it up as a string, but I know you can't pass range a string. Below is my code. I'm sure there's a simple way to do this. Any help? Thanks in advance!


    
    Sub Fill1()
    
    Dim Tracker1 As Integer
    
    Dim WB1 As Workbook
    
    Dim Loc1 As String
    
    Dim Value1 As Double
    
    
    
    Set WB1 = Workbooks("Subcontractor Rate Comparisons.xlsx")
    Set WS1 = WB1.Worksheets("Midwest")
    
    Tracker1 = 7
    Loc1 = "T" + Str(Tracker1)
    
    Do
    
        Do
        
            WB1.Worksheets("Midwest").Range(Range1).Value = ActiveCell.Value
        
            ActiveCell.Offset(0, 1).Select
            
        
            Tracker1 = Tracker1 + 1
            Loc1 = "T" + Str(Tracker1)
    
        Loop Until IsEmpty(ActiveCell)
        
        ActiveCell.Offset(1, -3).Select
    
    Loop Until IsEmpty(ActiveCell)
        
        
    '
    End Sub
    Last edited by atoy3731; 08-19-2011 at 03:27 PM.

  2. #2
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,230

    Re: Multiple Workbook Range Referencing?

    A sample workbook, or two, would be helpful with before and after scenarios.


    Regards

  3. #3
    Registered User
    Join Date
    08-19-2011
    Location
    Washington, DC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Multiple Workbook Range Referencing?

    Quote Originally Posted by TMShucks View Post
    A sample workbook, or two, would be helpful with before and after scenarios.


    Regards
    Thanks for the response.

    Here's an example of the 2 workbooks (I can't give you the actual workbooks as they are classified information). In need to fill the box in Workbook1 downwards using the box in Workbook2. For Workbook2, I need to go across (C3->D3->E3) then linefeed down and repeat (C4->D4->E4).

    Hopefully that makes sense. Thanks in advance for any help!
    Attached Files Attached Files

+ 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.2.0