+ Reply to Thread
Results 1 to 4 of 4

Object variable or With block variable not set" error message

  1. #1
    Registered User
    Join Date
    04-22-2009
    Location
    Centennial, CO
    MS-Off Ver
    Excel 2003
    Posts
    1

    Object variable or With block variable not set" error message

    I have taken over a project for someone at work and am getting an "Object variable or With block variable not set" error message.

    The line producing the error is "ActiveSheet.Columns(fCol2).Find(What:="= ( 0+", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=True).Activate"

    I'm not sure what this line is looking for - can someone interpret this for me?

    Thanks!
    Last edited by JoeS; 04-22-2009 at 10:39 AM. Reason: Poor Title

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: New to Excel - need help

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: New to Excel - need help

    hi Joe,

    Can you please edit your thread title to describe your problem (as per Rule #1)?
    This allows the forum to be more easily searched & helps people see at a glance if they can help you.

    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Object variable or With block variable not set" error message

    hi Joe,
    Thanks for modifying your thread title
    (OC, you only just beat me to it!)

    Joe,
    This line of code aims to search the current sheet's formulae in the column number represented by "fCol2" for the string "= ( 0+". If this string is found it will select (or ".activate") the cell containing the string. If it is not found, the error you have experienced will appear.

    Taking a potshot... I suspect that the sheet previously contained formulae that have either been over-written or changed to values.

    A better approach to overcome this error is to wrap the ".find" statement within error handling & then add an appropriate course of action if nothing is found. Can you please attach more of the code, or even better, an example workbook (with no confidential data) for us to give better feedback?

    hth
    Rob

+ 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