Excel VB

Posted on 2014-08-12
Last Modified: 2014-08-12
I am developing a metrics tracking database in excel.  I have multiple worksheets, some that need to be consolidated or eliminated, but that is not the point, as it is still a work in progress. The firs issue I am having is that one worksheet, Home, needs to be the first worksheet that is opned everytime regardless of what worksheet was editited and saved in the previous session.  I don't want users being invited to dig around in other worksheets.  I created some vb script and put it at the top of that sheet that looks like this:

Private Sub Workbook_Open()
End Sub

simple but it doesn't work.  It won't open the file to the HOME worksheet everytime.

The second issue is that I created "Main Menu" buttons to return the users back to the home worksheet.  My problem is that when they click on that button and then navigate back to that worksheet they are looking at the main menu button.  How do ensure that everytime one of the three dashboard reoprts are open, Dashboard, HBUS Dashboard and HBCAdashboard are opened they open at the top of the sheet?  Is it as simple as writitng code into each sheet activiating cell A1?
Question by:Rrave26
    LVL 44

    Accepted Solution

    That code needs to be in ThisWorkbook, not the sheet.
    LVL 44

    Expert Comment

    by:Martin Liss
    As for your second question, yes, it's that simple or you could to this after activating the sheet


    Author Closing Comment

    Well that did it, thanks for helping a newbie out.
    LVL 44

    Expert Comment

    by:Martin Liss
    You're welcome and I'm glad I was able to help. We are all newbies in the beginning.

    In my profile you'll find links to some articles I've written that may interest you.
    Marty - MVP 2009 to 2014

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
    This script will sweep a range of IP addresses (class c only, and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
    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 in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

    758 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

    11 Experts available now in Live!

    Get 1:1 Help Now