MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 26th, 2002, 11:31 PM   #1
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

I am delving into some of the graphics capabilities in Excel and would like to see some other ideas...

Thanks,
Tom
Tom Schreiner is offline   Reply With Quote
Old Apr 26th, 2002, 11:37 PM   #2
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

Hey Tom,

http://www.mvps.org/dmcritchie/excel/excel.htm

a veritable smorgassboard of links here


__________________
:: Pharma Z - Family drugstore ::
Chris Davison is offline   Reply With Quote
Old Apr 26th, 2002, 11:47 PM   #3
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Thanks Chris
Tom Schreiner is offline   Reply With Quote
Old Apr 27th, 2002, 12:31 AM   #4
Joe Was
MrExcel MVP
 
Joe Was's Avatar
 
Join Date: Feb 2002
Location: Central Florida, USA
Posts: 7,541
Default

This will draw a triangle based upon the values in C9,10,11 and indicate the area in C13. The values should be 0.1 to about 4, to fit on the sheet. JSW

Sub DrawP()
Dim x1, x2, x3, y1, y2, y3

x1 = Range("N2")
y1 = Range("O2")
x2 = Range("N3")
y2 = Range("O3")
x3 = Range("N4")
y3 = Range("O4")
Range("A1").Select
On Error GoTo Err
Set myDocument = Worksheets(1)
myDocument.Shapes.SelectAll
Selection.Cut
With myDocument.Shapes.BuildFreeform(msoEditingCorner, x1, y1)
.AddNodes msoSegmentLine, msoEditingAuto, x2, y2
.AddNodes msoSegmentLine, msoEditingAuto, x3, y3
.AddNodes msoSegmentLine, msoEditingAuto, x1, y1
.ConvertToShape
End With
myDocument.Shapes.SelectAll
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 43
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 2#
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 64
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)

ActiveSheet.Buttons.Add(80.25, 192.75, 90, 27.75).Select
Selection.OnAction = "DrawP"
Selection.Characters.Text = "Calculate"
With Selection.Characters(Start:=1, Length:=9).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 9
End With
ActiveSheet.Buttons.Add(353.25, 57, 54, 16.5).Select
Selection.OnAction = "myReSet"
Selection.Characters.Text = "ReSet"
With Selection.Characters(Start:=1, Length:=5).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 9
End With
Range("A1").Select
'With myDocument.Shapes(1)
' vertArray = .Vertices
' x1 = vertArray(1, 1)
' y1 = vertArray(1, 2)
' MsgBox "First vertex coordinates: " & x1 & ", " & y1
'End With
End
Err:
ActiveSheet.Buttons.Add(80.25, 192.75, 90, 27.75).Select
Selection.OnAction = "DrawP"
Selection.Characters.Text = "Calculate"
With Selection.Characters(Start:=1, Length:=9).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 9
End With
ActiveSheet.Buttons.Add(353.25, 57, 54, 16.5).Select
Selection.OnAction = "myReSet"
Selection.Characters.Text = "ReSet"
With Selection.Characters(Start:=1, Length:=5).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 9
End With
Range("A1").Select
'With myDocument.Shapes(1)
' vertArray = .Vertices
' x1 = vertArray(1, 1)
' y1 = vertArray(1, 2)
' MsgBox "First vertex coordinates: " & x1 & ", " & y1
'End With
End Sub
Sub myReSet()
Set myDocument = Worksheets(1)
myDocument.Shapes.SelectAll
Selection.Cut
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("C11").Select
ActiveCell.FormulaR1C1 = "0"
ActiveSheet.Buttons.Add(80.25, 192.75, 90, 27.75).Select
Selection.OnAction = "DrawP"
Selection.Characters.Text = "Calculate"
With Selection.Characters(Start:=1, Length:=9).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 9
End With
ActiveSheet.Buttons.Add(353.25, 57, 54, 16.5).Select
Selection.OnAction = "myReSet"
Selection.Characters.Text = "ReSet"
With Selection.Characters(Start:=1, Length:=5).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 9
End With
Range("A1").Select
End Sub

The required sheet formulas are:

I1: Point3x
I2: =((C9*C9)+(C11*C11)-(C10*C10))/2*C11
J1: Point3y
J2: =SQRT((C9*C9)-(I2*I2))
K1: Area
K2: =C11*J2/2
L1: X
L2: 0
L3: 0
L4: =I2
M1: Y
M2: 0
M3: 0
M4: =J2
N1: NodeX
N2: =INT((L2*100)+P2)
N3: =INT((L3*100)+P2)
N4: =INT((L4*100)+P2)
O1: NodeY
O2: =INT((M2*100)+Q2)
O3: =INT((M3*100)+Q2)
O4: =INT((M4*100)+Q2)
P1: StartPosX
P2: 200
Q1:StartPosY
Q2: 100
B18: =IF(ISERROR(C13)=TRUE," Try a smaller length!","")

B19: =IF(AND(OR(C9+C10<=C11,C9+C11<=C10,C11+C10<=C9)*C9+C10+C11=0)," Note: A triangle of zero area cannot be calculated!",IF(OR(C9+C10<=C11,C9+C11<=C10,C11+C10<=C9)," Note: The length of one side must be less than the sum of the other two sides."," Note:"))
C13: =K2

Sheet Lables:
B6: Enter the Length of the sides of
B7: a triangle in the boxes below!
B9: Side 1 =
B10: Side 2 =
B11: Side 3 =
B13: Area =

If you add all this to Sheet1 and copy the Macros to Module1 and run the code once the macro buttons will be drawn automatically, hit Re-Set and add your test lengths. The Calculate button will draw the resulting triangle. JSW














[ This Message was edited by: Joe Was on 2002-04-26 23:59 ]

[ This Message was edited by: Joe Was on 2002-04-27 00:04 ]
Joe Was is offline   Reply With Quote
Old Apr 27th, 2002, 09:46 AM   #5
andy-s
Board Regular
 
Join Date: Mar 2002
Posts: 51
Default

Try

http://www.erlandsendata.no/english/...ads/charts.htm

http://edferrero.m6.net/

http://www.xl-logic.com/pages/charts.html
andy-s is offline   Reply With Quote
Old Apr 27th, 2002, 10:28 AM   #6
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Thanks Andy
Tom Schreiner is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:29 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes