This code will work on whichever sheet is currently active, but will not continue on to loop through ALL of the sheets. I can't figure out what's wrong. Does something else need to be initialized? Thanks for any suggestions...I'm pulling my hair out!
Sub Fill_Zero_if_HasBorder()
Dim my_range As Range
Dim my_sheet As Worksheet
Dim c As Variant
For Each my_sheet In Sheets
Set my_range = Range("A1:CA200")
For Each c In my_range
If IsEmpty(c.Value) = True Then
If c.Borders(xlEdgeTop).LineStyle <> xlLineStyleNone Then
If c.Borders(xlEdgeBottom).LineStyle <> xlNone Then
If c.Borders(xlEdgeLeft).LineStyle <> xlNone Then
If c.Borders(xlEdgeRight).LineStyle <> xlNone Then
c.Value = "0"
End If
End If
End If
End If
End If
Next c
Next my_sheet
End Sub
Bookmarks