?
Solved

Problem finding correct place for code

Posted on 2014-04-30
6
Medium Priority
?
172 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 50

Expert Comment

by:Martin Liss
ID: 40032631
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 35

Assisted Solution

by:Norie
Norie earned 1000 total points
ID: 40032639
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 35

Expert Comment

by:Norie
ID: 40032679
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Frank Freese
ID: 40032935
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 50

Accepted Solution

by:
Martin Liss earned 1000 total points
ID: 40032945
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
ID: 40033182
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

862 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