View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default Editing a simple macro

ActiveSheet.Unprotect Password:="justme"

ActiveWindow.LargeScroll ToRight:=4
Range("HH12:IO19").Select
Selection.Copy
ActiveWindow.LargeScroll ToRight:=-4
ActiveWindow.SmallScroll Down:=9
Range("X20:AG21").Select

ActiveSheet.Protect Password:="justme"


Gord Dibben Excel MVP

On Fri, 25 Nov 2005 11:51:40 -0800, "Connie Martin"
wrote:

I have this simple macro, which works fine:

Sub CopyFormDM()
'
' CopyFormDM Macro
' Macro recorded 11/25/2005 by Connie Martin
'

'
ActiveWindow.LargeScroll ToRight:=4
Range("HH12:IO19").Select
Selection.Copy
ActiveWindow.LargeScroll ToRight:=-4
ActiveWindow.SmallScroll Down:=9
Range("X20:AG21").Select
End Sub

I would like to password protect the form and edit the macro so that part of
the macro is to unprotect the form first, run the rest of the macro and then
password protect it again before ending. When I recorded the macro that way
and then later ran it, it stopped for me to put in the password, and then
ended by protecting it without a password. I would like to edit the macro so
that it puts the password in to unprotect and puts it in again to protect. I
realize anyone looking at the macro in VB will see the password but this file
is to be used by people who most likely don't know how to do that, and if
they did, it would be no big harm done.

Thank you
Connie Martin