View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
WLMPilot
 
Posts: n/a
Default Protecting a worksheet / workbook with macros

The macros are activated by clicking a command button. Since I have Jan -
Dec set up within the same spreadsheet, I created buttons w/ macros for each
so that you can click on a certain month and that month appears on the
screen. Therefore, it is not a one-time thing where the macro is executed.

Being new to macros and VBA, I am not sure what the code is that you typed
in your response to my initial question.

Thanks,
Les

"Kevin B" wrote:

Unprotect the worksheet, run your code and then reprotect the worksheet:

With ActiveSheet
.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True, Password:="Password"
.EnableSelection = xlUnlockedCells
End With

"Your current macro code here

ActiveSheet.Unprotect Password:="Password"

--
Kevin Backmann


"WLMPilot" wrote:

I have setup spreadsheets (within one workbook) that lets you enter info in
the computer to assist in balancing your checkbook instead of having to
manually write down the uncleared transactions and then calculate.

The problem is this: I have macros in this workbook and I am trying to
protect the worksheet / workbook. However, when I protect it, the macros do
not work. As soon as I unprotect it, the macros work.

Any suggestions?

Thanks,
Les