+ Reply to Thread
Results 1 to 5 of 5

Help with replacing formula

  1. #1
    Forum Contributor
    Join Date
    05-07-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    215

    Help with replacing formula

    Hello everyone. I am trying to create formula and need a little help.

    I am working with Columns K and R. I need a formula that if any cell in column K has the word Blue. The formula clears any text in the corresponding R cell and puts the word Black

    So when the formula runs. If K24 has the word Blue, then any text in R24 is deleted and replaced with the word Black.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Help with replacing formula

    Unfortunately, formulas in excel cannot remove/delete or insert anything in any cell other than the cell where formula is written• For what you asking you need VBA•
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    05-07-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    215

    Re: Help with replacing formula

    How would this be done via VBA ?

  4. #4
    Forum Contributor
    Join Date
    07-10-2012
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: Help with replacing formula

    Sub Replacecell()
    Dim lRow As Long


    lRow = 1

    Do While (Cells(lRow, "K") <> "")
    Range(Cells(lRow, "k"), Cells(lRow, "k")).Select



    If ActiveCell.Value = "blue" Then
    Range(Cells(lRow, "r"), Cells(lRow, "r")).Select
    ActiveCell.Value = "Black"
    Range(Cells(lRow, "k"), Cells(lRow, "k")).Select
    'Selection.Insert Shift:=xlDown

    End If
    lRow = lRow + 1
    Loop


    End Sub

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Help with replacing formula

    morevijay1982 please use code tags when posting code (see my signature for how to)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replacing strings/ replacing numbers and letters
    By Insert Name in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2015, 01:15 PM
  3. Replacing anything after the last parenthetical in a formula
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-20-2014, 12:52 PM
  4. Replacing cell value without replacing formula in the cell
    By kingoftheace in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-17-2012, 06:28 AM
  5. replacing formula with result?
    By francisos in forum Excel General
    Replies: 4
    Last Post: 11-25-2008, 10:15 AM
  6. Replacing info mid formula
    By dagindi in forum Excel General
    Replies: 1
    Last Post: 06-02-2008, 03:26 PM
  7. [SOLVED] Replacing Sheet name in formula
    By Ron McCormick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2006, 05:00 PM

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