Hello all. I have used this site extensively for a number of questions that I've had, but only now registered. Smart folks on this board, for sure.
By altering some macros that I found through searching, I have managed to get two macros that perform precisely the way that I want them to perform. I have to use both of them to get my desired result, though. I have created a macro that basically runs the other two macros in sequence, but it isn't quite what I'm looking for. The reason is, in order to modify this macro to work with slight variations (to the area labeled "Vendor Code"), I have to modify both the first macro and the macro that runs both (hope this makes sense), as I would like to have a Macro that performs all of this for multiple different Vendor Codes, independent of others. It would be easier if 1 macro just performed all of the functions and I could modify (or mirror) it to run a different Vendor Code. How do I put all of the functions from the two supplied macros in to one macro?
First I have it highlight all rows that have certain values in column E:
Then I have it filter column E to show only cells that contain no fill. From there, it deletes all of those rows and goes back to the filter to display everything that is remaining:
Thanks in advance for any help.
By altering some macros that I found through searching, I have managed to get two macros that perform precisely the way that I want them to perform. I have to use both of them to get my desired result, though. I have created a macro that basically runs the other two macros in sequence, but it isn't quite what I'm looking for. The reason is, in order to modify this macro to work with slight variations (to the area labeled "Vendor Code"), I have to modify both the first macro and the macro that runs both (hope this makes sense), as I would like to have a Macro that performs all of this for multiple different Vendor Codes, independent of others. It would be easier if 1 macro just performed all of the functions and I could modify (or mirror) it to run a different Vendor Code. How do I put all of the functions from the two supplied macros in to one macro?
First I have it highlight all rows that have certain values in column E:
Code:
Sub HighlightVendorXYZ()
Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("E:E"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "VendorCode1" Or (cell.Value) = "VendorCode2" _
Then
If del Is Nothing Then
Set del = cell
Else: Set del = Union(del, cell)
End If
End If
Next cell
On Error Resume Next
With del.EntireRow.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -4.99893185216834E-02
.PatternTintAndShade = 0
End With
End Sub
Then I have it filter column E to show only cells that contain no fill. From there, it deletes all of those rows and goes back to the filter to display everything that is remaining:
Code:
Sub FilterNoFills()'
' FilterNoFills Macro
'
'
ActiveSheet.Range("$A$1:$CN$285999").AutoFilter Field:=5, Operator:= _
xlFilterNoFill
Rows("2:2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
ActiveSheet.Range("$A$1:$CN$7766").AutoFilter Field:=5
End Sub
Thanks in advance for any help.
Last edited: