Developed a spreadsheet where the user will have access to only certain cells while others are locked. The sheet also has a print button with the actual print code in VB. The problem I'm having is the user cannot access the unprotected cells without the sheet printing. The sheet also prints when the user clicks and points on a protected cells. It all seems like one's mouse is linked to the print macro.
Here the code for the print macro:
Note the print code is housed in a single module. I have several worksheets in one workbook that are assigned to the print module. There is also a main login sheet that requires the user to enter their password. Once entered, the user is taken a designated worksheet. The user see's only their worksheet; the other user worksheets are XlVeryHidden.
Note also the cells were lock/unlocked and worksheet protected through excel. I originally formatted all the cells in the worksheet and set the lock to “check”. I than formatted the range of cells that a user could change and set the lock to “uncheck”. Finally, I protected the worksheet. I even tried the reverse (unlock all and then lock followed by protect worksheet). Same results. Any help would be greatly appreciated.
Here the code for the print macro:
Code:
Sub Print_Sheet_Click()
'
'Print_Sheet_Click Macro
'
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
Note the print code is housed in a single module. I have several worksheets in one workbook that are assigned to the print module. There is also a main login sheet that requires the user to enter their password. Once entered, the user is taken a designated worksheet. The user see's only their worksheet; the other user worksheets are XlVeryHidden.
Note also the cells were lock/unlocked and worksheet protected through excel. I originally formatted all the cells in the worksheet and set the lock to “check”. I than formatted the range of cells that a user could change and set the lock to “uncheck”. Finally, I protected the worksheet. I even tried the reverse (unlock all and then lock followed by protect worksheet). Same results. Any help would be greatly appreciated.