Creating a report-change text in D cell based upon text in E cell

  • I have created a few macros to automatic format and arrange date I place into my macro enabled spreadsheet. I pull these reports 10 times each Monday with different data but same data layout. I cannot figure out a macro I can execute to look at each cell in the E column and if it contains the word "Implement" replace the text in the D column with "Flagged". Same row in this example. I need the macro to check every cell in the E column, Can you help?

  • Try this.

    Boo!:yikes:

  • this is the code I tried and get a 438 error

  • Hello,


    The sheet name looks a bit strange ... just make sure you are using the exact same spelling as the one in your tab ....

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • @lvchoc


    Code Tags Added
    Your post does not comply with our Forum RULES. Use code tags around code.


    Posting code between

    Code

    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.


    Highlight your code and click the # icon at the top of your post window.


    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

  • I really appreciate all the help. Still getting an error. I changed my sheet name to a simple one and it matches. I have a total of 5 columns and I am targeting column 5 & 5, D & E. Here is the code. What am I doing wrong?


    Sub ReplaceFlagged()
    Dim arrIn As Variant
    Dim idxRow As Long


    With Sheets("RptTemplate").CurrentRegion.Columns(5).Resize(, 4)


    arrIn = .Value


    For idxRow = LBound(arrIn, 1) To UBound(arrIn, 1)
    If arrIn(idxRow, 5) = "Impediment" Then
    arrIn(idxRow, 4) = "Flagged"
    End If
    Next idxRow


    .Value = arrIn


    End With
    Application.ScreenUpdating = True
    End Sub

  • Hello,


    Actually ... to be in a position to solve your problem ...


    You should attach a small sample file ... which would allow to make a few tests ...:smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • here is a sample of the data
    [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="width: 73"]Issue key[/TD]
    [TD="width: 319"]Summary[/TD]
    [TD="width: 104"]Due Date[/TD]
    [TD="width: 166"]Status[/TD]
    [TD="width: 168"]Custom field (Epic Status)[/TD]

    [/tr]


    [tr]


    [td]

    EVENT-225

    [/td]


    [td]

    Example 1

    [/td]


    [TD="align: right"]9/30/2019[/TD]

    [td]

    In Progress

    [/td]


    [td]

    Impediment

    [/td]


    [/tr]


    [tr]


    [td]

    EVENT-53

    [/td]


    [td]

    Example 2

    [/td]


    [TD="align: right"]10/17/2019[/TD]

    [td]

    In Progress

    [/td]


    [td][/td]


    [/tr]


    [tr]


    [td]

    EVENT-155

    [/td]


    [td]

    Example 3

    [/td]


    [TD="align: right"]10/24/2019[/TD]

    [td]

    In Progress

    [/td]


    [td][/td]


    [/tr]


    [tr]


    [td]

    EVENT-158

    [/td]


    [td]

    Example 4

    [/td]


    [TD="align: right"]10/24/2019[/TD]

    [td]

    In Progress

    [/td]


    [td]

    Impediment

    [/td]


    [/tr]


    [tr]


    [td]

    EVENT-156

    [/td]


    [td]

    Example 5

    [/td]


    [TD="align: right"]10/24/2019[/TD]

    [td]

    In Progress

    [/td]


    [td][/td]


    [/tr]


    [tr]


    [td]

    EVENT-157

    [/td]


    [td]

    Example 6

    [/td]


    [TD="align: right"]10/24/2019[/TD]

    [td]

    In Progress

    [/td]


    [td][/td]


    [/tr]


    [/TABLE]

  • At the risk of repeating myself ...


    Quote

    You should attach a small sample file ... which would allow to make a few tests ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Great ... !!


    Once your sample file was attached ... matter could be quickly solved ...:wink:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!