dirtybathtowel
New Member
- Joined
- Feb 9, 2023
- Messages
- 1
- Office Version
- 2016
- Platform
- Windows
Hi all,
I have a workflow manager for customer service that lists cases row-by-row, including a column for the "next step" which tells me at all times what I need to do next for each particular case.
My problem is that I am trying to write a Sub called Highlight_Actionables() that highlights cells in the "next step" column when the row fulfills certain conditions.
Currently in one sheet of cases I have this formula:
This works perfectly, but when I paste it over into another sheet, it doesn't work. I've adjusted the range from D to F because that's where the step column now is, and changed the offset from 4 to 5 because there's an additional row inbetween the steps column and PONum column now. Everything works as it should, and I can see that the code iterates through every line even on the new sheet, returning appropriate values in MsgBox for ActiveCell.Value and PONumCell.Value. Yet, for some reason, it just refuses to highlight the steps (D) cell now. I've tried everything and it won't highlight, just on my sheet. I'm sure all the references are correct. Any help is appreciated.
I have a workflow manager for customer service that lists cases row-by-row, including a column for the "next step" which tells me at all times what I need to do next for each particular case.
My problem is that I am trying to write a Sub called Highlight_Actionables() that highlights cells in the "next step" column when the row fulfills certain conditions.
Currently in one sheet of cases I have this formula:
VBA Code:
Sub ActionablesHighlighting()
Application.ScreenUpdating = False
'Grabbing the "next step" column
Dim MyRange as Range
Set MyRange = Range("D3:D100")
Range("D3").Select
For i = 1 to MyRange.Count
Dim PONumCell as Range
Set PONumCell = ActiveCell.Offset(0,4)
If ActiveCell.Value = "Update PO number" And_
PONumCell.Value = "released" Or PO NumCell.Value = "Released" Then
ActiveCell.Interior.Color = vbYellow
End If
ActiveCell.Offset(1,0).Select
Next i
Range("D3").Select
Application.ScreenUpdating = True
End Sub
This works perfectly, but when I paste it over into another sheet, it doesn't work. I've adjusted the range from D to F because that's where the step column now is, and changed the offset from 4 to 5 because there's an additional row inbetween the steps column and PONum column now. Everything works as it should, and I can see that the code iterates through every line even on the new sheet, returning appropriate values in MsgBox for ActiveCell.Value and PONumCell.Value. Yet, for some reason, it just refuses to highlight the steps (D) cell now. I've tried everything and it won't highlight, just on my sheet. I'm sure all the references are correct. Any help is appreciated.