Solved

Problem finding correct place for code

Posted on 2014-04-30
6
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 48

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 34

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 34

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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 48

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
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.

688 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