+ Reply to Thread
Results 1 to 7 of 7

if cell contains specific text then change value of another cell

  1. #1
    Registered User
    Join Date
    04-09-2018
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    21

    if cell contains specific text then change value of another cell

    Hi guys, i need some help here.
    As you can see from my excel from Cell C there is an identity " ct2 or ct3"
    And from Cell B , there is a list of statement

    Example :
    "select qc_m, Version_n from v_vos_qc_ct2 where QC_M in ('PQC705');"

    i would want the Cell C information to overwrite the one i bold in Cell B.
    Is there a way to do that?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-12-2015
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    36

    Re: if cell contains specific text then change value of another cell

    Jovan,

    There were no macro's found in your sheet, so I'm guessing the information is put in manually.

    Use the following code to get what you want. This replaces your =replace code, which seems to be more used as the concentrate code shown below.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-09-2018
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    21

    Re: if cell contains specific text then change value of another cell

    Quote Originally Posted by Rekragisao View Post
    Jovan,

    There were no macro's found in your sheet, so I'm guessing the information is put in manually.

    Use the following code to get what you want. This replaces your =replace code, which seems to be more used as the concentrate code shown below.

    Please Login or Register  to view this content.
    Hi Rekragisao,
    They tell me i have error in the code.

  4. #4
    Registered User
    Join Date
    03-12-2015
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    36

    Re: if cell contains specific text then change value of another cell

    Quote Originally Posted by Jovan Yong View Post
    Hi Rekragisao,
    They tell me i have error in the code.
    Jovan,

    Please provide the given error, most likely its the way the code is divided. try using , instead of ;

  5. #5
    Registered User
    Join Date
    04-09-2018
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    21

    Re: if cell contains specific text then change value of another cell

    They just give me a pop up saying there is a problem with the formula

  6. #6
    Registered User
    Join Date
    03-12-2015
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    36

    Re: if cell contains specific text then change value of another cell

    Jovan,

    Please elaborate more, providing aid is difficult when there is very little information to go on.

    Make sure that all the spacing's (; in my code) are set to your excels standard (either ; or ,). you can check this by seeing if after every spacing the code shifts from text1 to text2 etc. Otherwise paste the code in there, bypass the error and evaluate the code. Excel will then show you where the error occurs.

    The code works fine for me so it should be an issue with preferences.

  7. #7
    Registered User
    Join Date
    04-09-2018
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    21

    Re: if cell contains specific text then change value of another cell

    Thanks! Yup, i change to , and it works.

+ 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. Change Font Color of cell if another cell contains specific text
    By Cubajz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2017, 05:19 AM
  2. How do i change the text in a specific cell based off of criteria in another
    By DCrofty in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2016, 01:20 PM
  3. [SOLVED] Conditional Formatting to change text in cell if other cell contains specific letter
    By RichTea88 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-06-2014, 06:47 AM
  4. If a cell has a specific text, how to change different cell to another text
    By indipindi99 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-03-2013, 09:03 PM
  5. Lookup two cells for specific text then change another cell
    By tweitzel79 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-22-2013, 12:33 PM
  6. Replies: 0
    Last Post: 03-12-2013, 04:29 PM
  7. [SOLVED] Change color of specific text within a cell?
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2006, 12:35 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