+ Reply to Thread
Results 1 to 2 of 2

My First VBA attempt (Dashboard with Arrows and Ranges)

  1. #1
    Registered User
    Join Date
    05-19-2010
    Location
    Findlay Ohio
    MS-Off Ver
    Excel 2003
    Posts
    9

    My First VBA attempt (Dashboard with Arrows and Ranges)

    Hi. I am trying to make a simple Dashboard that will place an arrow in a Green Yellow or Red area based on a value I enter into a certain cell.

    The arrows for the dashboard are all located behind it. I just need to bring the specific one to the front and hide the other ones. For now to keep it simple I just want to use 1 arrow in each zone. (3 total)

    I am a beginner using VBA and I don't understand how to define my variables or which commands I should use. Could you take a look at my program and fix it for me? Thank you.

    Here is my really crappy code with my comments ( Sorry I know nothing about VBA coding)

    HTML Code: 
    Attached Files Attached Files
    Last edited by neokeelo; 08-05-2010 at 04:29 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: My First VBA attempt (Dashboard with Arrows and Ranges)

    Please Login or Register  to view this content.
    Here is an update for you, however, this code is not correct. You can see you set your green, red, and yellow ranges. However, toward the end you say if AH33 = RangeColor. A range can't be equal to another range. That is like saying if New York = Chicago. You need to look at a specific aspect of the range, usually the value. So you can say:

    Please Login or Register  to view this content.
    However, that won't quite work as RangeGreen is a number of cells, and thus has multiple values. So you're going to need to decide what you are comparing AH33 to, and continue from there. My guess is you'll need to define the greatest and least values in each colored zone, then check the Input to see which zone it lies in. Good Luck, and feel free to ask any questions that come up.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1