Ini file

  • Thread starter Thread starter spinner
  • Start date Start date
S

spinner

is there anyone who knows if and how i can put my code in an INI file so its
always possible to change it at any time?
Thanks
Example code
---------------------------------------------------------
If Application.UserName = ("-username-") Then
Blad1.Visible = xlSheetVisible
Blad2.Visible = xlSheetVisible
Blad3.Visible = xlSheetVisible
End If
 
Try this

Maybe this?

You must protect your project also in the VBA editor because a user can't unhide
the sheets there also if you don't do that

The first sheet of the workbook is always visible( welcome sheet)
It will unhide the sheet with the same name as the usename if the user open the workbook

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
' sheet 1 is the "Menu" sheet
Dim a As Integer
For a = 2 To Sheets.Count
Sheets(a).Visible = xlVeryHidden
Next a
End Sub

Private Sub Workbook_Open()
On Error Resume Next
Sheets(Application.UserName).Visible = True
On Error GoTo 0
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top