+ Reply to Thread
Results 1 to 4 of 4

Trouble using 'Is Not Nothing'

  1. #1
    Registered User
    Join Date
    04-03-2014
    Location
    Woodbury, GA
    MS-Off Ver
    Excel 2010 and Excel 2013
    Posts
    37

    Trouble using 'Is Not Nothing'

    I have a spreadsheet I'm trying to automate (I find that once people find out you can do that type of thing, they have more for you to do ). I have the code below. When I run the code, it returns a 'Compile Error: Invalid Use of Argument' and highlights the 'Is Not Nothing' portion of my conditional statement. I asked google what it thought about this, but it wasn't giving me much that was helpful.

    I would be grateful if someone could point in the direction of an answer to this problem. Thank you.

    Here's the code...
    Please Login or Register  to view this content.
    Last edited by EverGreen1231; 01-22-2016 at 10:55 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Trouble using 'Is Not Nothing'

    Try

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Trouble using 'Is Not Nothing'

    If CurrentLineName was an object you would use Not CurrentLineName Is Nothing, but since it isn't an object you wouldn't use Nothing.

    Try using CurrentLineName<>"".
    Last edited by Norie; 01-22-2016 at 10:56 AM.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    04-03-2014
    Location
    Woodbury, GA
    MS-Off Ver
    Excel 2010 and Excel 2013
    Posts
    37

    Re: Trouble using 'Is Not Nothing'

    Quote Originally Posted by zbor View Post
    Try

    Please Login or Register  to view this content.
    That works, thank you. I've run into the problem I mentioned above several times and usually use some other method to circumvent it.

    Quote Originally Posted by Norie View Post
    If CurrentLineName was an object you would use Not CurrentLineName Is Nothing, but since it isn't an object you wouldn't user Nothing.

    Try using CurrentLineName<>"".
    Well, I suppose that would make sense. Silly me.

    Thank you both for your replies.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Trouble with 0
    By Eric McGehee in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 01-29-2015, 05:26 PM
  2. [SOLVED] Trouble with looking up value
    By bottera in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-11-2013, 05:13 PM
  3. MIN-MAX trouble
    By JoKnows in forum Excel Formulas & Functions
    Replies: 30
    Last Post: 03-26-2013, 11:05 PM
  4. Trouble with API
    By pasteis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2012, 01:34 PM
  5. if and trouble
    By mojobaabby in forum Excel General
    Replies: 3
    Last Post: 08-16-2011, 07:33 PM
  6. Still having trouble
    By scott in forum Excel General
    Replies: 3
    Last Post: 05-17-2006, 03:10 PM
  7. [SOLVED] If than Else Trouble
    By Goofy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-19-2006, 06:50 AM

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