Solved

Problem finding correct place for code

Posted on 2014-04-30
6
165 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 46

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 33

Assisted Solution

by:Norie
Norie earned 250 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 33

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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 46

Accepted Solution

by:
Martin Liss earned 250 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

861 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