+ Reply to Thread
Results 1 to 7 of 7

Editing a module for detect certain characters

  1. #1
    Registered User
    Join Date
    03-24-2016
    Location
    Canada
    MS-Off Ver
    Mac
    Posts
    63

    Wink Editing a module for detect certain characters

    Hi there,

    I have this code

    Please Login or Register  to view this content.
    This works perfectly. It looks for the characters and fills the cell with the corresponding text. However, when the cell is blank OR does not contain any of the characters, it fills with "textiles". Can we please find a way for the cell to just be left blank instead of defaulting to "textiles".

    Does this make sense?

    Thank you.

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

    Re: Editing a module for detect certain characters

    What do you actually have in the cells you are using this function on?

    I ask because it's not actually the value in the cell you are checking in the code.

    You appear to be splitting the value passed to the function using '.' as a delimiter and then checking the 3 element of the resultant array.

    If you passed a blank cell or empty string that would immediately cause problems.

    I suppose you could deal with empty cells like this.
    Please Login or Register  to view this content.
    Last edited by Norie; 05-17-2017 at 12:04 PM.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    03-24-2016
    Location
    Canada
    MS-Off Ver
    Mac
    Posts
    63

    Re: Editing a module for detect certain characters

    The cells it is checking look like:

    HDN.J.TB.20.1
    HDN.J.TB.20.2
    HDN.B.TB.15.1
    HDN.B.TB.15.2
    HBD.B.BE.1.2
    HBD.B.BE.1.1
    etc..


    The code posted gives me the #VALUE! in the blank cells

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

    Re: Editing a module for detect certain characters

    The code I posted will return an empty string if the cell passed to it is empty or contains an empty string.

  5. #5
    Registered User
    Join Date
    03-24-2016
    Location
    Canada
    MS-Off Ver
    Mac
    Posts
    63

    Re: Editing a module for detect certain characters

    Ah yep. You are right. Now, I do have some cells that have a 0 in them, can we check this and then return an empty cell too?

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

    Re: Editing a module for detect certain characters

    Try this.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-24-2016
    Location
    Canada
    MS-Off Ver
    Mac
    Posts
    63

    Re: Editing a module for detect certain characters

    This worked the best ever. Thank you so much

+ 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. Prob editing workbook that contains module
    By reluctanttreasurer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-15-2015, 03:03 PM
  2. [SOLVED] How to create a formula to detect if cell has certain characters?
    By felipemejiag in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-24-2014, 07:26 AM
  3. [SOLVED] How to detect leading or trailing apostrophe and quote characters
    By kyjae in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-23-2014, 07:55 AM
  4. Editing An Excel Module
    By alcharbonneau in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-24-2012, 09:41 AM
  5. Editing Module name creates problems in macro list
    By maxedison in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2009, 03:51 PM
  6. how to detect characters and add columns
    By pvboston in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2007, 07:56 PM
  7. Detect if cell is in 'editing' mode
    By mkgan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2007, 03:15 AM

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