Hi,
I recorded a macro to be used on Workbook Open which finds and replaces blank looking cells to truly make them blank. However, I keep getting the following error:
Run-time error '1004':
Method 'Cells' of object '_Global' failed
Does anyone know what the issue is with my code & what a possible solution might be?
Option Explicit
Private Sub Workbook_Open()
Application.ScreenUpdating = False
ActiveSheet.Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveSheet.Cells.Replace What:="", Replacement:="------", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveSheet.Cells.Replace What:="------", Replacement:="", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Application.ScreenUpdating = True
End Sub
Thanks for any help on this!
Bookmarks