+ Reply to Thread
Results 1 to 4 of 4

Need VBA Code to Replace Old text depend upon col BL,BG, and AY.

  1. #1
    Forum Contributor
    Join Date
    04-30-2013
    Location
    washington
    MS-Off Ver
    Excel 2019
    Posts
    168

    Need VBA Code to Replace Old text depend upon col BL,BG, and AY.

    Dear Expert

    I have data which need to validate and replace the value depend upon multiple filtering

    Filter#1
    IF BL = LAG,

    Filter#2
    IF BG = OCOGS - Spares - Transfer Price Overhead and OFSS - ORCL Consulting Prod Cost I/C.

    Filter#3
    IF AY = BOA_033E OR BOA_011G, Replace in BG Col with OCOGS - Spares - Transfer Price Overhead
    Rest of all = OFSS - ORCL Consulting Prod Cost I/C

    Find the Attachment
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: Need VBA Code to Replace Old text depend upon col BL,BG, and AY.

    Hi there,

    Not sure about your 'expected outcome' for rows 2 & 3 as the first filter in column BL is not LAG, hence not met.

    Try the attached file.

    The code below will output the result in column 'BN' for testing. Just update 'BN' with 'BG' once happy with the code.



    Please Login or Register  to view this content.
    Attached Files Attached Files
    If your Question is answered; please mark it SOLVED. If you are happy with a member's solution, say 'Thanks' and click the 'Star' to Add Reputation.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,262

    Re: Need VBA Code to Replace Old text depend upon col BL,BG, and AY.

    Is that your actual file setup...All those blank Column Headers...
    No need for loop or filter...Can be replaced in one go I'm guessing...
    Last edited by sintek; 03-26-2023 at 06:08 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    04-30-2013
    Location
    washington
    MS-Off Ver
    Excel 2019
    Posts
    168

    Re: Need VBA Code to Replace Old text depend upon col BL,BG, and AY.

    Solved ORoss!! Thanks alot

+ 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] VB Code to find and replace text
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2023, 05:59 PM
  2. Need VBA code to Split Data move to target workbook sheet depend upon unique values
    By henrybrothers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2022, 06:06 PM
  3. [SOLVED] VB Code to find text and replace with defined text
    By rmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-21-2021, 03:04 PM
  4. [SOLVED] Replace a text with bold text in vba code
    By abhi_jain80 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-17-2021, 01:46 PM
  5. [SOLVED] Change cell to a color depend on certain text
    By srgtennis in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-01-2018, 03:25 PM
  6. Need code to Replace text with Date
    By winmaxservices in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2015, 05:30 AM
  7. [SOLVED] Need Help on code to pull data from particular wb not all depend upon column header vba
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2014, 02:07 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