steveo0707
Board Regular
- Joined
- Mar 4, 2013
- Messages
- 85
- Office Version
- 365
- 2019
- Platform
- Windows
Below is a sample of the current code I am using in excel to highlight cells when our products are in a box. The code worked fine until I increased the number of Rows it needed to go through.
I'm not very good with loops so need some help rewriting this as a loop;so it can scan 200 rows x 7 columns wide.
Ideally, I would want the code to scan all rows and look for three things. Scan Column E for the words "Working On" then Select cell in Column A and highlight it Yellow. Scan through Column E for the words "In Box" then Select Cells in Column A & B and Highlight Yellow. Then I need it to Scan Column F for the letter "D" and then select Cell in column C and highlight an off green color.
Any help would be greatly appreciated
I'm not very good with loops so need some help rewriting this as a loop;so it can scan 200 rows x 7 columns wide.
Ideally, I would want the code to scan all rows and look for three things. Scan Column E for the words "Working On" then Select cell in Column A and highlight it Yellow. Scan through Column E for the words "In Box" then Select Cells in Column A & B and Highlight Yellow. Then I need it to Scan Column F for the letter "D" and then select Cell in column C and highlight an off green color.
Any help would be greatly appreciated
Code:
Sub ClearCells()'
' Clear Cells Once PArts Have Shipped
'
Application.ScreenUpdating = False
Range("H3").Select
If ActiveCell.FormulaR1C1 = "Shipped" Then
Range("A3:G3").Select
Range("A3:G3").ClearContents
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Range("H4").Select
If ActiveCell.FormulaR1C1 = "Shipped" Then
Range("A4:G4").Select
Range("A4:G4").ClearContents
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Range("H5").Select
If ActiveCell.FormulaR1C1 = "Shipped" Then
Range("A5:G5").Select
Range("A5:G5").ClearContents
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If