Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Prevent user from selecting a cell (97)

    I want to use a worksheet as a menu screen which contains command buttons to select other worksheets. I have removed the gridlines from my menu sheet and added the buttons and functionality. My problem is that I don't want the user to be able to select a cell on this sheet. I've seen it done elsewhere but I can't find a method to do it. Any suggestions.
    Rob
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Prevent user from selecting a cell (97)

    Try the following on the relevant sheet :

    From the Controls Toolbox menu select the properties tab and with any cell of th esheet selected, set the EnableSelection property to xlNoSelection. Then protect the worksheet. Cells cannot then be selected.

    To do the by VBA use something like :

    With Worksheets("Menu")
    .EnableSelection = xlNoSelection
    .Protect Contents:=True, UserInterfaceOnly:=True
    End With

    But I think it woul dbe necessary to run that code each time the workbook is opened

    Andrew c

  3. #3
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Prevent user from selecting a cell (97)

    Hi Andrew
    Many thanks for your quick response. I used the vba code as a This Workbook On_Open procedure and it works beautifully. It's exactly what I've been looking for.
    Regards
    Rob
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

Posting Permissions

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