• Prevent user from selecting a cell (97)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Prevent user from selecting a cell (97)

    Author
    Topic
    #378535

    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

    Viewing 0 reply threads
    Author
    Replies
    • #626975

      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

      • #627070

        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

    Viewing 0 reply threads
    Reply To: Prevent user from selecting a cell (97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: