+ Reply to Thread
Results 1 to 4 of 4

Looking up project invoices

  1. #1
    Registered User
    Join Date
    04-12-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    2

    Looking up project invoices

    I have a button in my workbook that when clicked should open another workbook travel to the desired sheet and copy all of the rows with a specified project number into a new workbook.

    With the following code, I get a "Compile Error: Object Expected" but I don't know why. Thoughts?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Looking up project invoices

    Hi, sidkdbl07,

    at which line in the code?

    whatīs the value of locateMasterInvoices? You set currentWB but you donīt use it in your code. And shouldnīt you only copy the cells being visible via SpecialCells(xlCellTypeVisible)?

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    04-12-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Looking up project invoices

    Please Login or Register  to view this content.
    currentWB could be deleted. You're correct i don't use it anywhere.

    I think the error occurs on the following line
    Please Login or Register  to view this content.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Looking up project invoices

    Hi, sidkdbl07,

    my fault - I should have read the code more carefully.

    You may Set an object if itīs a workbook, a worksheet, a range, a chart, a shape but you canīt Set a string, only make sure that the variable gets the value by
    Please Login or Register  to view this content.
    The code is untested still but maybe it can help:
    Please Login or Register  to view this content.
    Ciao,
    Holger

+ Reply to Thread

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