+ Reply to Thread
Results 1 to 2 of 2

Help with an error message

  1. #1
    Registered User
    Join Date
    06-23-2006
    Posts
    34

    Help with an error message

    My macro has worked fine previously and all of a sudden this error message comes up:

    Object Variable or WIth block variable not set

    This happens on the last line of this:

    Sheets("Menu").Select
    Future = Cells(34, 2).Value
    If Future = Empty Then GoTo 1
    Sheets("Portfolio Valuation").Select
    Cells.Find(What:=Future).Select

    Basically I am asking the marco to seach for the word Liab, which I have entered a on a sheet, and it calls this Future as above. Then it seaches for this word on the sheet Portfolio Valuation.

    Please help!!!

  2. #2
    Tom Hutchins
    Guest

    RE: Help with an error message

    There is nothing intrinsically wrong with your code. You are getting the
    error because it cannot find, on the Portfolio Valuation sheet, the text it
    read from cell B34 on the Menu sheet (which you have assigned to the variable
    Future).

    Possibilities:
    - You entered the search text (Liab) incorrectly
    - You entered it into the wrong cell (not B34 on the Menu sheet)
    - The search text doesn't exist on the Portfolio Valuation sheet

    If the .Find may fail sometimes in your routine and that's legitimate, you
    need to add some error handling.

    Hope this helps,

    Hutch

    "CarolineHedges" wrote:

    >
    > My macro has worked fine previously and all of a sudden this error
    > message comes up:
    >
    > Object Variable or WIth block variable not set
    >
    > This happens on the last line of this:
    >
    > Sheets("Menu").Select
    > Future = Cells(34, 2).Value
    > If Future = Empty Then GoTo 1
    > Sheets("Portfolio Valuation").Select
    > Cells.Find(What:=Future).Select
    >
    > Basically I am asking the marco to seach for the word Liab, which I
    > have entered a on a sheet, and it calls this Future as above. Then it
    > seaches for this word on the sheet Portfolio Valuation.
    >
    > Please help!!!
    >
    >
    > --
    > CarolineHedges
    > ------------------------------------------------------------------------
    > CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
    > View this thread: http://www.excelforum.com/showthread...hreadid=560184
    >
    >


+ 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