Solved

Problem finding correct place for code

Posted on 2014-04-30
6
159 Views
Last Modified: 2014-04-30
Folks,
I have tried to work through the code on the list box "Topics" where the user double- clicks on the Topic so it takes them directly to the desired worksheet. I've tried to execute the GoToSelect module in the double-click event so I could then delete the command button  GotToSelection rather than hide this command button.
Financial-Analysis-Revised.xlsm
0
Comment
Question by:Frank Freese
  • 2
  • 2
  • 2
6 Comments
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
I don't understand what you are asking. When I double-click one of the topics it goes to the associated sheet. What do you want to do differently?
0
 
LVL 33

Assisted Solution

by:Norie
Norie earned 250 total points
Comment Utility
When I double click an item in the Topics listbox I'm taken to the relevant sheet.

Is that not what you want to happen?

Is there some other problem?

If you want to get rid of the hidden Goto Selection button move the code to the Double Click event of the listbox.
Private Sub lstTopic_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim strSheetName As String

    On Error GoTo ErrorRoutine

    strSheetName = Worksheets("SheetNames").Range("ShowSheet")(intListIndex)

    GotoSelection.Enabled = True
    ResetIndicators
    Application.Goto Sheets(strSheetName).Range("A1"), True
    Exit Sub
ErrorRoutine:
    MsgBox "The 'Go To Selection' sheet name for your selection needs to be added to sheet 'SheetNames'"

End Sub

Open in new window

PS I substituted all the activate/select with Application.Goto which will do the same thing.
0
 
LVL 33

Expert Comment

by:Norie
Comment Utility
Actually that won't work because there's something else, well perhaps more than one thing, going on.

PS Why a Click and DblClick for the listbox? They actually appear to be clashing.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:Frank Freese
Comment Utility
Martin & Imnorie,
When I first started this project (from another workbook) the user could click on a Topic and it would go to another section on the  worksheet where the user could click on the command button "Go To Selection". Later it was suggested just double-click on the Topic list box . I've since eliminated everything below the two list boxes and text box and just having the user double-click on the Topic. I've bounced all around trying to make this work. So what I did was simply keep the command button Go To Selection but made it invisible. That's not very good design. I even created a module modGoToSelection and placed that in the double-click event for the Topic list box.  I get this error:
go to selectionI've included the file that this error appears.
Financial-Analysis-Revised.xlsm
0
 
LVL 45

Accepted Solution

by:
Martin Liss earned 250 total points
Comment Utility
Here's a wb that works. Most if not all of the credit should go to imnorie because he understood what you wanted and came up with (most of) the answer. My changes are marked with 'new.
Financial-Analysis-Revised.xlsm
0
 

Author Closing Comment

by:Frank Freese
Comment Utility
Perfect - I'm surprised at how close I was just missed a few items.
That's why I called you all
Thanks again!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now