+ Reply to Thread
Results 1 to 6 of 6

Need a VBA code to check if condition across column replace with new text in cell F&G

  1. #1
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Need a VBA code to check if condition across column replace with new text in cell F&G

    Hi experts

    i need an solution with rawdata

    i have 4 column in if condition calculation get replace with desired value in F & g

    if G col "PO" and B = "G5 PIT" then Under account type if values are met these 4 condition "BH-11710","ER-13855","PG-18895","US-2015-134026" in list select then i want replace with colmn F as MYOB_INVOICE and G as MYOB

    see i and j col is my desired result

    find the attachment.

    thanks alot
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi, try this !


    According to your attachment a VBA demonstration as a beginner starter :

    PHP Code: 
    Sub Demo1()
        For 
    R& = 2 To [A1].CurrentRegion.Rows.Count
            
    If Cells(R2) = "G5 PIT" And Cells(R7) = "PO" Then
                
    If IsNumeric(Application.Match(Cells(R4), [M1].CurrentRegion0)) Then
                    Rows
    (R).Columns("F:G") = Array("MYOB_INVOICE""MYOB")
                
    End If
            
    End If
        
    Next
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

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

    Re: Need a VBA code to check if condition across column replace with new text in cell F&G

    Please Login or Register  to view this content.
    Last edited by jindon; 10-22-2022 at 08:32 AM.

  4. #4
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: Need a VBA code to check if condition across column replace with new text in cell F&G

    hi experts its works small changes in code i want set criteria lookup range in another new sheet or add criteria in code? pls help on this

  5. #5
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Need a VBA code to check if condition across column replace with new text in cell F&G

    Hi breadwinner.

    Please try this code:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: Need a VBA code to check if condition across column replace with new text in cell F&G

    Thanks Boss!! Its solved Thanks for your time

+ 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] Adding Exclusion Condition for Cell Value Error Check Code
    By liquidmettle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-02-2019, 09:27 AM
  2. check if text in cell is available in a column
    By dxr346 in forum Excel General
    Replies: 9
    Last Post: 03-29-2017, 03:55 AM
  3. [SOLVED] Find text in column A and replace it with text in cell B1
    By Grens in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2016, 08:25 PM
  4. Vba code to check a number in a cell against numbers in a column
    By Buddy8 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-07-2014, 03:33 PM
  5. Check cell contains if contains text check another column.
    By thequiff in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2013, 07:29 AM
  6. [SOLVED] Makro with if condition to check for numeric and text values in a cell range
    By Postlki1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2013, 07:53 AM
  7. Code to replace text in a range of cells in a particular column
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-16-2007, 06:57 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