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.
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!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks