+ Reply to Thread
Results 1 to 6 of 6

Compare Cell Value with Multiple Strings

  1. #1
    Registered User
    Join Date
    03-13-2019
    Location
    United States
    MS-Off Ver
    2016
    Posts
    3

    Compare Cell Value with Multiple Strings

    Hey you all,
    Hope all doing Great!

    I am trying to compare the single cell value with multiple string but its not working..

    if Worksheets("RawData").Cells(i,3).Value = " Person1" Then

    I have tried comparing multiple stirng such as if Worksheets("RawData").Cells(i,3).Value = " Person1" or "Person2" Then

    But it didn't work, any suggestions..

    Thanks in advance!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,913

    Re: Compare Cell Value with Multiple Strings

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data and to post your entire code explaining in simple English what you want to happen using your Workbook examples.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,558

    Re: Compare Cell Value with Multiple Strings

    You need to change to something like

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

  4. #4
    Registered User
    Join Date
    03-13-2019
    Location
    United States
    MS-Off Ver
    2016
    Posts
    3

    Re: Compare Cell Value with Multiple Strings

    After saving the Excel sheets which includes VBA code, then, the VBA code disappears. Is it normal? Do I have write VBA code each time?

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,558

    Re: Compare Cell Value with Multiple Strings

    If you don't save the workbook as "Macro Enabled workbook", all vba code will be cleared.

  6. #6
    Registered User
    Join Date
    03-13-2019
    Location
    United States
    MS-Off Ver
    2016
    Posts
    3

    Re: Compare Cell Value with Multiple Strings

    Hi jindon, oh got it. Thanks again!

+ 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. Compare similar text strings, line up two records and bring back a cell value
    By JoeExcelStruggler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2019, 12:15 AM
  2. Compare similar text strings, line up two records and bring back a cell value
    By JoeExcelStruggler in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2019, 05:42 AM
  3. Replies: 4
    Last Post: 05-30-2015, 11:45 AM
  4. [SOLVED] Format individual strings out of multiple strings within a cell with VBA
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-18-2013, 07:33 PM
  5. [SOLVED] Excel Compare Strings in Multiple Sheets
    By Nu2Java in forum Excel General
    Replies: 3
    Last Post: 08-25-2012, 08:09 AM
  6. Replies: 3
    Last Post: 05-28-2011, 01:43 PM

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