Dear,
I have the below code on my Excel that is being run by the "Freeze" icon button on the top.
However, currently it freezes only the data of the sheet "GENERAL"
I want this macro to freeze the data of ALL the sheets. How could I adjust that?
'Freeze all the data of all the sheets when clicking on the Freeze Data button
Sub ReplaceFormulasWithValuesAllSheets()
On Error GoTo ErrorEncountered
Dim wks As Worksheet
Dim errorOccurred As Boolean
Dim confirmFreeze As Integer
Dim Language As String
Language = ThisWorkbook.Worksheets("GENERAL").Range("I4").Value
If Language = "Fran?ais" Then
confirmFreeze = MsgBox(ThisWorkbook.Worksheets("VALIDATIONS").Range("AJ2").Value, vbYesNo + vbQuestion, "Confirm Freeze")
ElseIf Language = "English" Then
confirmFreeze = MsgBox(ThisWorkbook.Worksheets("VALIDATIONS").Range("AJ3").Value, vbYesNo + vbQuestion, "Confirm Freeze")
ElseIf Language = "Nederlands" Then
confirmFreeze = MsgBox(ThisWorkbook.Worksheets("VALIDATIONS").Range("AJ4").Value, vbYesNo + vbQuestion, "Confirm Freeze")
Else
' Add here a msgbox or another way to handle other languages
End If
If confirmFreeze = vbNo Then
Exit Sub
End If
errorOccurred = False
Application.EnableEvents = False
ExitPoint:
On Error GoTo 0
Application.EnableEvents = True
If errorOccurred Then
If Language = "Fran?ais" Then
MsgBox (ThisWorkbook.Worksheets("VALIDATIONS").Range("AK2").Value)
ElseIf Language = "English" Then
MsgBox (ThisWorkbook.Worksheets("VALIDATIONS").Range("AK3").Value)
ElseIf Language = "Nederlands" Then
MsgBox (ThisWorkbook.Worksheets("VALIDATIONS").Range("AK4").Value)
Else
' Add here a msgbox or another way to handle other languages
End If
Else
If Language = "Fran?ais" Then
MsgBox (ThisWorkbook.Worksheets("VALIDATIONS").Range("AL2").Value)
ElseIf Language = "English" Then
MsgBox (ThisWorkbook.Worksheets("VALIDATIONS").Range("AL3").Value)
ElseIf Language = "Nederlands" Then
MsgBox (ThisWorkbook.Worksheets("VALIDATIONS").Range("AL4").Value)
Else
' Add here a msgbox or another way to handle other languages
End If
End If
Exit Sub
ErrorEncountered:
errorOccurred = True
Resume ExitPoint
End Sub
Thanks
Simon
Bookmarks