+ Reply to Thread
Results 1 to 6 of 6

Text replacing formula gives out just lowercase, help!

  1. #1
    Registered User
    Join Date
    02-18-2020
    Location
    Madrid, Spain
    MS-Off Ver
    MS office
    Posts
    5

    Text replacing formula gives out just lowercase, help!

    Hi all,

    Since this is my first post ever, i will try my best to describe my problem as understandable and structured as possible.
    Feedback is of course highly appreciated.

    The objective is to find a word in a range of cells and replace it by another word. No matter if the word which is to be found is capitalized or not.

    Example. In cell is word "APPle-Pie", the part "APPle/apple/APPLE" (no matter of big or small) should be replaced by "Apple"

    The code:

    Please Login or Register  to view this content.
    Idea:
    Loop through list Cells (1-7,1), lower the cells with the replace function, see if part of word or entire word matches with Cells(1-3,2), and replace it by Cells(1-3,3).
    Everything works fine, besides that even tho the list with the replacements Cells(1-3,3) contains capitalized letters, when replaced for words in Cells (1-7,1) they are often in small letters.
    It gets completely strange when sometimes they are big and sometimes small.

    I hope you understood the issue and one of you can help me.
    Thank you anyway!

    Stay tuned!
    Last edited by Halil93; 02-25-2020 at 07:08 PM. Reason: solved!

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Text replacing formula gives out just lowercase, help!

    welcome to the forum you can try replacing below in your 2nd for Loop
    Please Login or Register  to view this content.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Registered User
    Join Date
    02-18-2020
    Location
    Madrid, Spain
    MS-Off Ver
    MS office
    Posts
    5

    Re: Text replacing formula gives out just lowercase, help!

    hi hemesh,

    thank you for your comment.

    I have tried it and it is replacing the it perfectly.

    But the issue i wanted to solve by adding lcase() to the code is, that the word i want to replace (1-7,1) has to be exactly equal to the word which is in the 2nd list Cells(1-3,2).

    Example:
    If 1st list exactly equal 2nd list
    1st list apple Cells(1-7,1), 2nd list apple Cells(1-3,2), replaced with 3rd list pear Cells(1-3,3) -> apple replaced by pear.

    If 1st not exactly equal 2nd list
    1st list ApPLe Cells(1-7,1), 2nd list apple Cells(1-3,2), replaced with 3rd list pear Cells(1-3,3) -> ApPLe not replacedby pear. Because ApPLe is not exactly equal to apple.

    With lcase i could change every word from 1st list to lower case. In list 2 every word would be in lower case, to always exactly match with 1st list.

    I hope that could explain why i used lcase().
    The issue i have now is explained in the post.

    Kind regards and thank you again for commenting.

    Cheers and happy Sunday

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,769

    Re: Text replacing formula gives out just lowercase, help!

    Hi & welcome to the board.
    How about
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-18-2020
    Location
    Madrid, Spain
    MS-Off Ver
    MS office
    Posts
    5

    Re: Text replacing formula gives out just lowercase, help!

    Hi Fluff13,

    magical!
    It is working perfectly.
    I didnīt know about binary comparison and text comparison.

    That was very helpful and i learned a lot as well.
    Thumbs up!

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,769

    Re: Text replacing formula gives out just lowercase, help!

    You're welcome & thanks for the feedback

+ 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. [SOLVED] Replacing text in formula from within VB
    By stevetalaga in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2015, 02:09 AM
  2. Replies: 6
    Last Post: 04-25-2014, 10:31 AM
  3. Formual or VBA for replacing text in a formula
    By jvbeats in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-13-2012, 04:43 PM
  4. Convert lowercase text to uppercase text in Excel
    By mls_newbee in forum Excel General
    Replies: 1
    Last Post: 09-22-2010, 01:14 PM
  5. Help with replacing text with formula
    By dan96max in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2009, 10:57 AM
  6. convert a range of lowercase text to upper text or vice versa
    By jackdaw in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-16-2005, 05:06 PM
  7. Formula for Replacing Text in a String?
    By David Godinger in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-16-2005, 10:06 AM

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