Eloise T
Active Member
There are 4 tabs (worksheets) in this workbook.
The last few rows of each worksheet has a white background.
When I run the VBA, I want it to highlight in yellow those last few
rows containing data and then "beep" 3 times to indicate it's done.
It works except it is also coloring 2 blank rows beyond the rows
containing data ...which I don't want.
I've run out of parameters to change. I'm sure it's an easy fix but I just don't see it.
Help please...and Thank you in advance.
The VBA code is here but probably better to see it and run it in the attachment.
The last few rows of each worksheet has a white background.
When I run the VBA, I want it to highlight in yellow those last few
rows containing data and then "beep" 3 times to indicate it's done.
It works except it is also coloring 2 blank rows beyond the rows
containing data ...which I don't want.
I've run out of parameters to change. I'm sure it's an easy fix but I just don't see it.
Help please...and Thank you in advance.
The VBA code is here but probably better to see it and run it in the attachment.
Code:
Sub YellowHighlightColumnsAThroughH()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Formula Info" And ws.Name <> "Dave" Then
If ws.Cells(Rows.Count, "A").End(xlUp).Row > 2 Then 'Changed 3 to "A" which is the same.
With ws.[A3:H3].Resize(ws.Cells(Rows.Count, 3).End(xlUp).Row)
' > > > This VBA yellow-highlights ALL data-filled cells in the array of Columns A3 through H.
' A3:H3 array tells where to apply change(s). (Rows.Count, 3) tells in which row to start.
.Interior.Color = vbYellow '= RGB(255, 255, 0)
End With
End If
End If
Next
'3 BEEPS ---------------------------------------------------------------------------------------
Beep
' Pause a second before engaging the next Beep so they don't run together and sound like only one Beep.
' hrs:mi:secs
Application.Wait Now + TimeValue("0:00:01")
Beep
' Pause a second before engaging the next Beep so they don't run together and sound like only one Beep.
Application.Wait Now + TimeValue("0:00:01")
Beep
End Sub