+ Reply to Thread
Results 1 to 5 of 5

VBA Code word for text string comparison...

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    37

    Talking VBA Code word for text string comparison...

    Hey!

    I would like to know what code word should I use thato allow the program to read and compare text strings within VBA.

    for instance I have three columns

    A | B | C

    In column A, I will type the name of a thing (i.e. apples and pears)
    In column B I will type the amount of apples or pears that I ate on day 1
    In column C, I will type the amount of apples our pears that I ate on day 2

    Therefore the code should have the following format
    Please Login or Register  to view this content.
    Let me know... Thanks!
    Last edited by Leith Ross; 09-29-2009 at 04:54 PM. Reason: Added Code tags

  2. #2
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: VBA Code word for text string comparison...

    Why in VBA? - this would be so much easier to do in a formula.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: VBA Code word for text string comparison...

    Hello jgleon22,

    To make your posts easier to read, copy, and edit please wrap your code. I did it for you this time. Here is how you can do it next time.

    How to wrap your Code
    1. Select all your code using the mouse.
    2. Click on the # icon on the toolbar in the Message window. This will automatically wrap the text you selected with the proper Code tags to create a Code Window in your post.

    Use the Bulletin Board Code Tags
    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] at the end of the last line.


    As a member, You have agreed to follow the forum posting rules. Please take so time to familiarize yourself with the Do's and Don'ts here in the Forum, just click on the link below...

    Forum Rules
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    09-16-2009
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: VBA Code word for text string comparison...

    GuruWanaB:

    Hey! I am trying to do it using only VBA codes. I just need to know the codeword that will enable the code to differentiate between text strings.

    Let me know,
    Thanks!

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,977

    Re: VBA Code word for text string comparison...

    You would need to loop through each cell in column A, check if the text equals the value you want, then add up the other columns if so.
    Everyone who confuses correlation and causation ends up dead.

+ 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