+ Reply to Thread
Results 1 to 12 of 12

Rename help please for. Private Sub Worksheet_BeforeDoubleClick

  1. #1
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    Hi
    I have just copied a code from the internet, pasted to the worksheet but I already have a code with the same name

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

    Which is the best way to over come the ambiguous name detected error? Can I just rename one of them?
    Many thanks

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    No, there can only be 1 event procedure and if you rename one then it won't execute automatically. You will have to combine the codes using the Parameter Target to determine which block of code should execute.

  3. #3
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    Many thanks, I thought that might be the case. If I post the codes could you show me what I should do please?

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    Unless you post the code nobody can help.

    Someone will pick it up, probably not me as I'm using a phone but if it's still unanswered in a couple of hours...

  5. #5
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    This is the code I already have.

    Please Login or Register  to view this content.
    This also has a Form, Class Module and a Module attached to it.

    The new code.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    For which range(s) do you want DatePickerForm to be displayed and which range(s) should the 'new' code be for?
    If posting code please use code tags, see here.

  7. #7
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    The new code is only required on Sheet Inv_1 Range D22:K41.

    The DatePicker works in any cell on the worksheet so as long as it can work on cells V6 and V9 that would be good

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    Do you want the DatePicker code to only work on V6 and V9?

  9. #9
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    It I have the the code for DatePicker on a number of sheet but for this sheet just V6 and V9 is all it needs to work on Yes

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    Try this.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    Ok, thanks for this, I am still working on other bits and so I can't test it at the moment, will let you know when I get it sorted. Thanks

  12. #12
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Rename help please for. Private Sub Worksheet_BeforeDoubleClick

    All is good, thanks Norie.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Sub Worksheet_BeforeDoubleClick
    By ana.ciofrangeanu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2014, 10:31 AM
  2. Worksheet_BeforeDoubleClick Not Working
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2014, 06:50 AM
  3. Ambiguous name detected: Worksheet_BeforeDoubleClick
    By ConfusedaboutVBA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2013, 08:44 PM
  4. [SOLVED] Worksheet_BeforeDoubleClick - Time stamp
    By Jack40 in forum Excel General
    Replies: 1
    Last Post: 10-22-2012, 06:41 AM
  5. ambiguous name detected : Worksheet_beforedoubleclick
    By eina28 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2011, 05:04 AM
  6. Can Worksheet_BeforeDoubleClick work over a DropBox?
    By Wizz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-13-2009, 09:29 AM
  7. [SOLVED] Sub Worksheet_BeforeDoubleClick from elsewhere?
    By Jack Sons in forum Excel General
    Replies: 2
    Last Post: 11-02-2005, 06:17 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1