Results 1 to 14 of 14

Thread: Help Please :)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    May 2017
    Posts
    19
    Location

    Angry Help Please :)

    Hi.

    Before I begin please note I'm a complete newbie this is my first attempt at writing code. - I'm running excel 2013

    I'm trying to pull information from multiple spreadsheets into one "master" version. I spent the morning making the below code, which worked, I then expanded it to my other spreadsheets (20 in total), I went to run the macro and it will complete the first line then spit out an application/object defined error. Could anyone give me some tips of what I've done wrong and/or fix it

    Workbooks.Open Filename:= _
            "X:\089872 - IPW - Framework\02 Admin\01 DocRegisters\IPW-CAP-00-XX-RE-Z-0001.xlsx"
                
        Windows("Document Tracker.xlsm").Activate
        
        'TQ's
        Range("B7").Select
        ActiveCell.FormulaR1C1 = "='[IPW-CAP-00-XX-RE-Z-0001.xlsx]Framework'!R6C4"
        Range("B8").Select
        ActiveCell.FormulaR1C1 = "='[IPW-CAP-00-XX-RE-Z-0001.xlsx]Framwork'!R7C4"
        Range("B9").Select
        ActiveCell.FormulaR1C1 = "='[IPW-CAP-00-XX-RE-Z-0001.xlsx]Framework'!R8C4"
        Range("B10").Select
        ActiveCell.FormulaR1C1 = "='[IPW-CAP-00-XX-RE-Z-0001.xlsx]Framework'!R9C4"
        Range("B11").Select
        ActiveCell.FormulaR1C1 = "='[IPW-CAP-00-XX-RE-Z-0001.xlsx]Framework'!R10C4"
        
        'Paste as values
        Range("B7:B11").Select
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=zlNone, SkipBlanks _
        :=False, Transpose:=False
    The code continues but, it's pretty much the same type of code... Do I have to define the activecells? if so, tips on how to do that please.. getting rather confusing. Also I'd admit that the "activecell" lines were generated using the Record macro, thinking that I'd could just use that.

    Cheers in advance.
    Last edited by SamT; 05-24-2017 at 12:13 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •