Consulting

Results 1 to 4 of 4

Thread: excel help

  1. #1
    VBAX Regular
    Joined
    Aug 2016
    Posts
    12
    Location

    excel help

    i am trying to click on a unique number in 1 wookbook to open a reavent worksheet

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,729
    Location
    Quote Originally Posted by rjw29bs4 View Post
    i am trying to click on a unique number in 1 wookbook to open a reavent worksheet
    OK

    If there's a question or request in there, I'm afraid I missed it
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Regular
    Joined
    Aug 2016
    Posts
    12
    Location

    help

    Quote Originally Posted by Paul_Hossler View Post
    OK

    If there's a question or request in there, I'm afraid I missed it
    what i do i have a invoice wooksheet that has a invoice number 319525 for instance
    and i save it under that
    then when i do my accounts i list all my invoices numbers,date,cleint,and so on
    what i won't do do is when i click on the invoice number in the account sheet it opens up the relavent worksheet
    is this posable?

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,729
    Location
    If you put this in the Invoices code sheet, double clicking in a invoice row will open the invoice number worksheet



    Option Explicit
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        Dim sInvoice As String
        Dim x As Long
        
        sInvoice = Target.EntireRow.Cells(1, 1).Value
    
        If Len(sInvoice) = 0 Then Exit Sub
    
        x = -1
        On Error Resume Next
        x = Worksheets(sInvoice).Index
        On Error GoTo 0
        
        If x = -1 Then
            MsgBox sInvoice & " does not have invoice sheet"
            Exit Sub
        End If
        
        Worksheets(sInvoice).Select
    End Sub
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

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