Speedometer Dial in Excel 2003 and multiple images

mond007

New Member
Joined
Oct 9, 2008
Messages
34
Hi, I have seen various discussions about creating a speedometer style dial using 2007 etc but no conclusive way of doing it in 2003. (Maybe there isn’t). Anyway I set out to have a go myself.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
Ok, I started by creating 41 images files (1 file for every 2.5% interval) and thought of displaying what ever file is relevant for the Percentage that needs to be displayed. The idea was that if I set a certain cell value to say 50% the I was going to display the image file corresponding to a dial that showed the pointer at 50%. i.e. Chart_Dial_01_050_0.bmp etc. Likewise for the all the other files starting from 0% to 100% (i.e. Chart_Dial_01_000_0.bmp, Chart_Dial_01_002_5.bmp, Chart_Dial_01_005_0.bmp all the way upto Chart_Dial_01_100_0.bmp etc.
<o:p></o:p>
I decided to use a button & I used the following code :

Code:
[SIZE=3][FONT=Trebuchet MS]   img_file = ActiveWorkbook.Path & "/" & "Chart_Dial_01_000_0.bmp"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Trebuchet MS]   ActiveSheet.cmdb_chart_01.Picture = LoadPicture(img_file)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Trebuchet MS]   ActiveSheet.cmdb_chart_01.Caption = "Chart_Dial_01_000_0.bmp"[/FONT][/SIZE]
<o:p></o:p>
Currently I just used a few buttons to display different Percentages and works but the final solution would use a value in a certain cell.
<o:p></o:p>
See www.specialistwebdesign.com/chartdial.zip (place all files in the same dir).
<o:p></o:p>
THE PROBLEM : Anyway, I hit a snag in that this works BUT the drawback is that I have to have the commandbutton named and images in a certain dir meaning that if I was to send it to someone they would need to save the chart images to current directory. So, I want to make it portable and self contained in the source file. Also, I should be able to copy/create more speedometer dials easily as I might want several dials on one Worksheet.
<o:p></o:p>
Things I have tried. I have tried to copy a image to a new workbook and this maintains the image name on any worksheet. i.e. If I insert an image on to my current workbook and call it Picture000_0 (in the name drange box) and then subsequently copy it to another workbook then the file is still called the same. However if I copy a command button it does not maintain the command button name, it just allocated the next number i.e. commandbutton10.
<o:p></o:p>
The other thought I had was to create 41 buttons with pointer every 2.5% intervals and code to either make .visible or .invisible all other except that one I want to display. I am currently working on this but would welcome comments.
<o:p></o:p>
QUESTION : Does anyone know of a way I can load a picture that is within the current workbook and not external to the workbook. I really wanted to have a set of standard 41 images and just load then one I want depending upon the required percentage. BUT I can not find a way to referencing an image internal to the workbook. i.e. see the following code:
<o:p></o:p>
Code:
[FONT=Trebuchet MS]=EMBED("Forms.CommandButton.1","")[/FONT]
<o:p></o:p>
Thanks in advance for your thoughts. Kuldip
 

mond007

New Member
Joined
Oct 9, 2008
Messages
34
Yes, this one and a few others mentioned in this area.
I have looked at all the examples but the graphics are somewhat poor.

Kind Regards Kuldip.
 

Forum statistics

Threads
1,081,726
Messages
5,360,906
Members
400,602
Latest member
newaqua

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top