Results 1 to 3 of 3

Thread: Select a sheet by double-clicking

  1. #1
    Board Regular
    Join Date
    Aug 2018
    Posts
    56
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Select a sheet by double-clicking

    Hello,

    I have a huge workbook with several tabs. I would like to be able to select the tab called "Main" by simply double-clicking anywhere in the spreadsheet.

    I tried with the code below (ThisWorkbook module) but it does not work

    Code:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Sheets("Main").Activate
    'End Sub
    Thanks!

  2. #2
    Board Regular
    Join Date
    Jan 2018
    Posts
    233
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Select a sheet by double-clicking

    Quote Originally Posted by Bering View Post
    Hello,

    I have a huge workbook with several tabs. I would like to be able to select the tab called "Main" by simply double-clicking anywhere in the spreadsheet.

    Code:
    Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
    Sheets("Main").Activate
    End Sub
    Last edited by MoshiM; Sep 9th, 2019 at 06:06 AM.

  3. #3
    Board Regular
    Join Date
    Aug 2018
    Posts
    56
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Select a sheet by double-clicking

    Thank you very much




    Quote Originally Posted by MoshiM View Post
    Code:
    Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
    Sheets("Main").Activate
    End Sub

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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