Automate pulling Conditional formatting

Kcbundy

New Member
Joined
Apr 19, 2023
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Is there a way to pull data that has Highlight Cell conditional formatting to another worksheet. I can’t post the table because I work with patient info.
For example:
Cell E1 contains data that “needs reviewed” and has highlight cell conditional formatting to change to red. Cell C1 has the patient account record. I want all accounts where in column E contains “needs reviewed” to automatically pull information from the C column to another worksheet
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Conditional formatting:
Excel Formula:
=COUNTIF($E1,"*Needs Reviewed*")

Conditional pull you could do this with a VBA macro.

VBA Code:
Sub TransferToNewSheet(Optional SourceSheet As String = "Source Sheet", Optional TargetSheet As String = "Target Sheet")
    Dim CurRow, LastRow As Long
    Dim ss, ts As Worksheet
    Dim wsRow As Range
    Set ss = Sheets(SourceSheet)
    Set ts = Sheets(TargetSheet) ' Target will be overwritten
    LastRow = ss.Cells(Rows.Count, "E").End(xlUp).Row
    CurRow = 1
    For Each wsRow In ss.Range("$1:$" & LastRow).Rows
        If Cells(wsRow.Row, "E").Value = "Needs Reviewed" Then
            wsRow.EntireRow.Copy Destination:=ts.Range("A" & CurRow)
            CurRow = CurRow + 1
        End If
    Next

    ' Cleanup
    Set ts = Nothing
    Set ss = Nothing
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,603
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top