+ Reply to Thread
Results 1 to 5 of 5

Using ISNONTEXT in VBA Macro giving Compile error

  1. #1
    Registered User
    Join Date
    06-17-2013
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    1

    Unhappy Using ISNONTEXT in VBA Macro giving Compile error

    Howdy,

    I'm try to use the following code in a macro to help properly format a document but I keep getting a compile error, Sub or Function not defined. Any tips?

    Thanks,

    RowIndex = 2

    'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX LOOP START XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Do While Worksheets(1).Cells(RowIndex, 1).Value <> "" ' loop until above line is empty.
    'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    If IsNonText(Worksheets(1).Cells(RowIndex, 9).Value) = True Then
    Range(Cells(RowIndex, 8), Cells(RowIndex, 8)).Select
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    End If
    'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    RowIndex = RowIndex + 1
    Loop

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Using ISNONTEXT in VBA Macro giving Compile error

    error, Sub or Function not defined.
    You need to put the name of sub at the start and end it with end sub

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Using ISNONTEXT in VBA Macro giving Compile error

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  4. #4
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Using ISNONTEXT in VBA Macro giving Compile error

    Please edit your post to add "code tags".

    Go back to your post, Highlight the code text, and press the "#" pound-sign button.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

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

    Re: Using ISNONTEXT in VBA Macro giving Compile error

    There is no VBA function IsNonText.

    If you want to use the worksheet function ISNONTEXT use Application.WorksheetFunction.IsNonText (or Application.IsNonText).
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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