paradise
10-10-2013, 01:07 AM
Hi,
Currently I do have a two problem.First problem is regarding the password.When I enter the password,it displays the character instead of hiding the character by " * ".Below is the code.
Option Explicit
Option Compare Text
'Password to unhide sheets
Const pWord = "suresh"
Secondly,I have used a macro to hide all the sheets except exisiting/current sheet.It works very well.Now when I use macro to unhide the sheet by using below mentioned vba code,it prompt me to ask password which is in above vba code given & displays only specific sheet which I have mentioned in the code.Now what I want is that I want to get modify my code in such a way that it asks me which which sheet you want to get unhide instead of a single sheet.Below is the vba code-
Sub HideSheets()
'Set worksheet to Very Hidden so that it can only be unhidden by a macro
Dim i As Integer
For i = 1 To Sheets.Count
If Sheets(i).Name <> "List" Then Sheets(i).Visible = False
Next i
End Sub
Sub ShowSheets()
'Prompt the user for a password and unhide the worksheet if correct
Select Case InputBox("Please enter the password", _
"Enter Password")
Case Is = pWord
With Worksheets("pgwise")
.Visible = xlSheetVisible
.Activate
.Range("A1").Select
End With
Case Else
MsgBox "Sorry, that password is incorrect!", _
vbCritical + vbOKOnly, "You are not authorized!"
End Select
End Sub
Hope, you have understood well.If you require any further info,pls do let me know.Also,I am a learner which just has started learning from this website.
With Best Rgds,
suresh
Currently I do have a two problem.First problem is regarding the password.When I enter the password,it displays the character instead of hiding the character by " * ".Below is the code.
Option Explicit
Option Compare Text
'Password to unhide sheets
Const pWord = "suresh"
Secondly,I have used a macro to hide all the sheets except exisiting/current sheet.It works very well.Now when I use macro to unhide the sheet by using below mentioned vba code,it prompt me to ask password which is in above vba code given & displays only specific sheet which I have mentioned in the code.Now what I want is that I want to get modify my code in such a way that it asks me which which sheet you want to get unhide instead of a single sheet.Below is the vba code-
Sub HideSheets()
'Set worksheet to Very Hidden so that it can only be unhidden by a macro
Dim i As Integer
For i = 1 To Sheets.Count
If Sheets(i).Name <> "List" Then Sheets(i).Visible = False
Next i
End Sub
Sub ShowSheets()
'Prompt the user for a password and unhide the worksheet if correct
Select Case InputBox("Please enter the password", _
"Enter Password")
Case Is = pWord
With Worksheets("pgwise")
.Visible = xlSheetVisible
.Activate
.Range("A1").Select
End With
Case Else
MsgBox "Sorry, that password is incorrect!", _
vbCritical + vbOKOnly, "You are not authorized!"
End Select
End Sub
Hope, you have understood well.If you require any further info,pls do let me know.Also,I am a learner which just has started learning from this website.
With Best Rgds,
suresh