Results 1 to 4 of 4

Trouble using 'Is Not Nothing'

Threaded View

  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...
    Sub EverGreenPastures()
    '******* Put "Look Here" anywhere there are line names. *******'
    'first import all line names in the spreadsheet to an array for comparison.
    Sheets("Info").Select
    Dim LineNameArray(1 To 6) As String
    RowCountForLineNames = Range("A6000").End(xlUp).Row
    For i = 1 To RowCountForLineNames
        LineNameArray(i) = Range("A" & i).Value
    Next i
    
    'Put "Look Here" where needed.
    Sheets("AdHoc Report").Select
    Dim RowCount As Integer
    RowCount = Range("A50000").End(xlUp).Row
    For j = 1 To RowCount
        CurrentLineName = Range("A" & j).Value
        For k = 1 To UBound(LineNameArray)
        If CurrentLineName = LineNameArray(k) And CurrentLineName Is Not Nothing Then
            Range("Z" & j).Value = "Look Here"
        End If
        Next k
    Next j
    End Sub
    Last edited by EverGreen1231; 01-22-2016 at 10:55 AM.

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. 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