I have a workbook that is linked to another workbook
I have tried to write code to clear all zeroes on the activesheet, but cannot get it to work. Where the data is linked to another workbook and shows a zero is must be cleared , except where there is a zero is shown as a currency i.e. it has an R in front of the zero
Sub Clear_Zeroes_Blanks()
Dim lr As Long, i As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
Application.ScreenUpdating = False
Application.EnableEvents = False
For i = lr To 1 Step -1
With activeSheets
If (.Cells(i, "A").Resize(, 20).Value) = 0 Then
.Cells(i, "A").Resize(, 20).ClearContents
End If
End With
With activeSheets
If (.Cells(i, "A").Resize(, 20).Value) = vbNullString Then
.Cells(i, "A").Resize(, 20).ClearContents
End If
End With
Next i
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
I have attached the source workbook "Data analysis Dept 1.xlsx' as well as the destination workbook containing the macro "Data Analysis All Departments.xlsm"
Your assistance in resolving this is most appreciated
Bookmarks