Results 1 to 3 of 3
  1. #1
    rgscharf
    Guest

    Macros (Excel 2000)

    I wrote a macro to do a goal seek, but when I hide sheets or protect sheets, the macro doesn't work properly. How do I set it up so that the sheets are protected and hidden to users, but the macro still has the ability to make changes such as running a goal seek?

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros (Excel 2000)

    The macro will have to unprotect the sheet(s), make its changes, then re-protect the sheets.
    Legare Coleman

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros (Excel 2000)

    I think there are two possibilities:
    1) before you protect the sheet, lock the cell which is changing during the goal seek, so that it is still accessible after protection (or in other words, the macro still can change its contents on the sheet)
    2) if the goalseek is in a macro, you can unprotect the sheet, do the goalseek and protect it directly thereafter, like this

    ActiveSheet.Unprotect
    Range("B1").GoalSeek Goal:=0.05, ChangingCell:=Range("C1")
    ActiveSheet.Protect

Posting Permissions

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