+ Reply to Thread
Results 1 to 4 of 4

How can i check specific characters of a cell?

  1. #1
    Registered User
    Join Date
    04-08-2010
    Location
    toronto,ontario
    MS-Off Ver
    Excel 2003
    Posts
    4

    How can i check specific characters of a cell?

    Please Login or Register  to view this content.

    My problem is that class variable doesnt return any values when i try outputting it on a cell. my goal is to compare its value to the ones specified in the IF statements to see if that part of text exists within the cell. If somebody could help me it would be appreciated. I have attached all my code, what i am doing is counting the amount of times val1 is repeated within the second spreadsheet. the counter ( objName) is supposed to be seperated based on the different class values.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How can i check specific characters of a cell?

    1. For starters, suggest you put Option Explicit as the top line of the module, and then define variables until your code compiles.

    2. In this declaration, everything except count is declared as a variant.
    Please Login or Register  to view this content.
    It should be
    Please Login or Register  to view this content.
    3. Undeclared variable objname is not initialized before it's tested.

    4. Nobody's likely to provide any useful help without seeing the workbook (sanitized as required) and reading a clear explanation of what you're trying to do.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: How can i check specific characters of a cell?

    I'm having trouble understanding what you are trying to achieve here as its difficult to see what the code is doing when there is no data to refer to. Would it be possible to post a copy of the actual workbook together with something which shows what the desired output would look like.

    In response to your question about comparing strings, you may be helped by the INSTR function.
    Martin

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: How can i check specific characters of a cell?

    In addition to the posts above

    I'm surprised you get errors at all!

    Since
    Please Login or Register  to view this content.
    can only ever return ""

    I think you noticed that yourself
    My problem is that class variable doesnt return any values when i try outputting it on a cell
    How did you manage to raise errors in your If statements, especially considering your code does not compile because of a missing End If

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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