ryan0521
Board Regular
- Joined
- Dec 7, 2016
- Messages
- 79
Hello everyone,
Can someone fix my Macro, I have a workbook with only 1 sheet, this macro button will update their values if someone copy and paste another worksheet in my workbook.
However, if the sheets were not yet completed and already click the macro button, it keeps updating values again and an error appears that the macro wouldn't continue. Please fix my codes below.
Can someone fix my Macro, I have a workbook with only 1 sheet, this macro button will update their values if someone copy and paste another worksheet in my workbook.
However, if the sheets were not yet completed and already click the macro button, it keeps updating values again and an error appears that the macro wouldn't continue. Please fix my codes below.
Code:
Sub Recalculate_Click()
ActiveSheet.Unprotect Password:="FPRC"
Dim sht As Worksheet
Dim fnd As Variant
Dim rplc As Variant
fnd = "="
rplc = "="
For Each sht In ActiveWorkbook.Worksheets
sht.Cells.Replace what:=fnd, Replacement:=rplc, _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Next sht
ActiveSheet.Protect Password:="FPRC"
End Sub
Last edited by a moderator: