+ Reply to Thread
Results 1 to 4 of 4

Not equal to not working in macro to select workbooks.

  1. #1
    Registered User
    Join Date
    11-02-2012
    Location
    Atlanta, Ga
    MS-Off Ver
    Excel 2010
    Posts
    3

    Not equal to not working in macro to select workbooks.

    I am pulling data from multiple workbooks, often hundreds. The macro pulls all the data correctly from the other workbooks to the master sheet (PO Access) but then pulls B7:K36 from the master sheet resulting in a small amount of duplicate partial data. I have tried to use <> the master workbook but it does not seem to be recognized. If I remove the <> lines I get the same results. I have included the entire macro below.

    Sub Macro1()

    '
    ' Macro1 Macro
    '
    ' Keyboard Shortcut: Ctrl+d

    Set outplace = Workbooks("PO Access").Sheets("sheet1")
    '
    For Each wb In Workbooks
    If wb.Name <> "PO Access" Then
    wb.Sheets("sheet1").Range("A3:F3").Copy
    outrow = WorksheetFunction.Max(8, outplace.Range("A65536").End(xlUp).Offset(1, 0).Row)
    outplace.Range("A" & outrow).PasteSpecial xlPasteAll
    End If

    If wb.Name <> "PO Access" Then
    wb.Sheets("sheet1").Range("B7:K36").Copy
    outrow = WorksheetFunction.Max(8, outplace.Range("A65536").End(xlUp).Offset(1, 0).Row)
    outplace.Range("A" & outrow).PasteSpecial xlPasteAll
    End If

    Range("A1").Select

    Next wb


    End Sub

    Thanks for all your help.

  2. #2
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Not equal to not working in macro to select workbooks.

    Try adding the file extension:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-02-2012
    Location
    Atlanta, Ga
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Not equal to not working in macro to select workbooks.

    Thanks for the try but that didn't have any effect.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Not equal to not working in macro to select workbooks.

    try
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-02-2012
    Location
    Atlanta, Ga
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Not equal to not working in macro to select workbooks.

    I copied and pasted your line to replace the one I had with <> in it. Now it doesn't copy any data. Thank you for trying. I didn't realize what a unique question I had.

+ 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