Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 6 of 6

Thread: Search Cell Containing Character In Vba

  1. #1
    Join Date
    29th December 2005
    Posts
    200

    Search Cell Containing Character In Vba

    i just need to find cells containing a certain character. It can be anywhere in the cell. The character is -
    If cl.Value = "=*-*" Then
    If cl.Value = "=-*" Then
    If cl.Value = "*-*" Then
    If cl.Value = "*-" Then
    If cl.Value = "=*-" Then


    Im not sure what the right format is, ive searched cant find it.

    ps i can If cl.Value = "P-X1B" Then
    and the rest of my code and get it to work just fine...

    thanks

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    15th February 2007
    Location
    Athens, Greece
    Posts
    12

    Re: Search Cell Containing Character In Vba

    VB:
    If cl.Value Like "*-*" Then 
    
    
    Christos Lepesiotis

  3. #3
    Join Date
    29th December 2005
    Posts
    200

    Re: Search Cell Containing Character In Vba

    Quote Originally Posted by clepe
    VB:
    If cl.Value Like "*-*" Then 
    
    
    awesome thanks!

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    29th December 2005
    Posts
    200

    Re: Search Cell Containing Character In Vba

    how would i do that if i want it to be NOT like

    Excel Video Tutorials / Excel Dashboards Reports


  5. #5
    Join Date
    15th February 2007
    Location
    Athens, Greece
    Posts
    12

    Re: Search Cell Containing Character In Vba

    If I understand correct
    VB:
    If cl.Value Like "*-*" Then 
         'execute code for "-" existance
    Else 
         'execute code for "-" NOT existance
    End If 
    
    
    Christos Lepesiotis

  6. #6
    Join Date
    29th December 2005
    Posts
    200

    Re: Search Cell Containing Character In Vba

    A much easier way to not include something is with <> instead of an equal sign. I just figured that out figured i would add back to this post.

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

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

Possible Answers

  1. Replies: 4
    Last Post: January 16th, 2008, 12:51
  2. Search For Special Character * (Asterisk)
    By DBR01 in forum EXCEL HELP
    Replies: 2
    Last Post: January 2nd, 2008, 11:14
  3. Search For The Character ? Not Wildcard
    By ih8lazerbeams in forum EXCEL HELP
    Replies: 3
    Last Post: November 21st, 2006, 01:21
  4. search a line of code for a character
    By captain bob in forum EXCEL HELP
    Replies: 7
    Last Post: August 4th, 2006, 23:41
  5. VB search for character in textbox
    By max_lux in forum EXCEL HELP
    Replies: 2
    Last Post: February 7th, 2006, 09:34

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
  •  
porno