Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,071
Default macros

From the macro recorder:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowInsertingRows:=True
The above statement protects the sheet and allows the user to insert rows.
To allow the user to edit cells isn't done in the VBA Protect code. You
must setup those cells you want him to edit beforehand. Are you familiar
with the Locking/Unlocking of cells? If a cell is LOCKED and the sheet
protected, the user CANNOT edit that cell. If a cell is UNLOCKED and the
sheet is protected, the used CAN edit that cell.
All cells are LOCKED by default. What you have to do is select those cells
in which you want editing allowed, and UNLOCK those cells. First select all
the editing cells. Then click on Format - Cells - Protection tab and
uncheck the LOCKED box.
Now, the user CAN edit those cells as he wishes. Come back if you need
more. HTH Otto
"Lois" wrote in message
...
Hi
the macro runs as it is but i want to add the ability of users to insert
rows & edit cells into the macro. i dont know the 'code' for this or
where
to type it in the macro
thanks
--
Lois


"Otto Moehrbach" wrote:

Lois
I take it that nothing happens when you run these macros. Is that
correct? If so, try this: enter the following line of code as the first
line after the Dim statements:
MsgBox "Hello"
Run the macro. Do you see the "Hello" message box? If not, the macro is
not running. What is your macro security setting (Tools - Macro -
Security). If you are running Excel 2007, is the workbook located (on
your
hard drive) in a trusted source? HTH Otto
"Lois" wrote in message
...
Hi,
i had the macro assigned to a shortcut code. I have it detailed below
without the permissions to insert rows ect.

Sub ProtectAll()


Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="DESDS"
Next ws



End Sub
Sub UnProtectAll()


Dim wb As Workbook
Dim ws As Worksheet
Dim blnIsProtected As Boolean
Set wb = ActiveWorkbook

For Each ws In wb.Worksheets
ws.Unprotect Password:="DESDS"
Next ws

Set wb = Nothing
Set ws = Nothing


End Sub

--
Lois


"Otto Moehrbach" wrote:

Lois
Exactly what are you doing to run the macro?
Do you want the macro to run automatically? If so, when?
Post the macro you are trying to run. HTH Otto
"Lois" wrote in message
...
Hi,
I am trying to protect a workbook using a macro allowing users the
following
permissions:
insert rows, format cells, use auto filter. Have tried recording a
macro
&
typing the code in but i must be typing it in the wrong place as it
dosent
recognise it! can anyone help?
--
Lois








 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros: can you copy macros from one doc to another? Roady Excel Discussion (Misc queries) 1 June 12th 08 05:47 PM
Excel 2007 macros - how to merge 5 macros together into one Sue Excel Discussion (Misc queries) 1 April 16th 08 08:36 PM
Macros warning always shows up, even if all macros removed Joe M Excel Discussion (Misc queries) 1 December 20th 07 04:45 AM
Macros - copying macros from one computer to another TT Excel Discussion (Misc queries) 18 December 14th 06 03:24 AM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM


All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"