Results 1 to 7 of 7

Run an existing macron on all the sheets

Threaded View

jeriss Run an existing macron on all... 01-21-2023, 09:08 AM
MKLAQ Re: Run an existing macron on... 01-21-2023, 09:19 AM
jeriss Re: Run an existing macron on... 01-21-2023, 05:38 PM
MKLAQ Re: Run an existing macron on... 01-22-2023, 05:03 AM
jeriss Re: Run an existing macron on... 01-22-2023, 10:45 AM
MKLAQ Re: Run an existing macron on... 01-22-2023, 11:56 AM
jeriss Re: Run an existing macron on... 01-22-2023, 12:06 PM
  1. #1
    Forum Contributor
    Join Date
    12-03-2021
    Location
    Brussels
    MS-Off Ver
    Microsoft 365
    Posts
    186

    Run an existing macron on all the sheets

    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
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 02-08-2022, 02:23 PM
  2. dynamic formula to count through existing and new sheets(In google sheets)
    By wlinksanju in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 11-26-2020, 09:16 PM
  3. running a macron multipple times
    By phillyd023 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-29-2019, 11:45 AM
  4. [SOLVED] TO insert new sheets to the right of all existing sheets.
    By Vivek2705 in forum Excel General
    Replies: 4
    Last Post: 02-21-2019, 09:21 AM
  5. [SOLVED] Macron running extremely slow after update to Excel 2016
    By masben in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-08-2016, 11:26 AM
  6. Need help deleting sheets and moving existing sheets down in order
    By MAGICofSeth in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-27-2012, 06:13 PM
  7. Calling non-existing sheets
    By Arcady in forum Excel General
    Replies: 6
    Last Post: 10-29-2009, 08:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1