Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Thanked 0 Times in 0 Posts

    Copy/paste macros (2000 sr-1)

    Here is the scenario. We have about 50 workbooks which need to be modified. So what I did was modified one completely then I wrote a macro that copies the same data from the modified workbook into another one that is open. I did this by recording the actions. No I need the peice of code that selects the other workbook that is open automatically because when I recorded it, a name was given to this other book so that is in the code. In other words, how do I make the macro select the other open workbook.

    Also, if I want to make the macro automatically protect the sheet AND set a password to it, what is the code to set the password part.

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Kortrijk, Belgium
    Thanked 0 Times in 0 Posts

    Re: Copy/paste macros (2000 sr-1)

    Have a look at <A target="_blank" HREF= &sb=&o=&vc=1> this thread </A> to find out how to loop through a directory and automatically open files.

    The code to protect a worksheet with a password is simply:
    <pre>Sub ProtectIt()
    ActiveSheet.Protect Password:="hello"
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts