Results 1 to 2 of 2

Thread: [RESOLVED] Compare String

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    13

    Resolved [RESOLVED] Compare String

    Hi,

    I'm using VB in a Excel file. I have a cell that have the text "PRODANG Janeiro 2006". I want to compare that content with a string with this text "PRODANG Janeiro", how can i do it? Now to that work i'm comparing the cell to the string "PRODANG Janeiro 2006" but i want to compare it to "PRODANG Janeiro" and make the comparasion true.

    thanks

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Compare String

    say A1 has "PRODANG Janeiro" in it and B1 has "PRODANG Janeiro 2006" in it

    something like this...
    VB Code:
    1. If Range("A1") = Left(Range("B1"),Len(Range("A1")) then
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width