i am trying to click on a unique number in 1 wookbook to open a reavent worksheet
i am trying to click on a unique number in 1 wookbook to open a reavent worksheet
---------------------------------------------------------------------------------------------------------------------
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
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?
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
---------------------------------------------------------------------------------------------------------------------
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