Home |
Search |
Today's Posts |
#5
![]() |
|||
|
|||
![]()
Thanks!!
That worked...now I just need to figure out how to draw a line and have the degrees marked next to it in a field. (if you know how to do that it would be wonderfull for you to share :) however, I do plan to attempt learning much more about VB. Thanks again. "Harlan Grove" wrote: drbob2000 wrote... I could not get the macro to run (I don't have much experience with this)...there was a syntax error....How do I get the properties of the line....and yes I am measuring the angle from the horrizontal. .... The problem may be line wrapping. First, use a general code module in VBA. Press [Alt]+[F11] to switch to the VB Editor, then run the menu command Insert Module. That'll bring up a new, blank general code module. Then paste the following code into it. Sub rfh() Dim s As Shape If TypeOf Selection Is Line Then Set s = ActiveSheet.Shapes(Selection.Index) Else MsgBox Prompt:="No drawn line selected", Title:="ERROR" Exit Sub End If With Application.WorksheetFunction MsgBox _ Prompt:=.Atan2( _ s.Width, _ IIf(s.VerticalFlip, 1, -1) * s.Height), _ Title:="Angle of selected line to horizontal (radians)" End With End Sub Also, you must select a drawn line before running this macro. Otherwise, it'll display an error dialog then exit. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to change line spacing for text box in excel chart | Charts and Charting in Excel | |||
A 2 line text showing up in the Cell in Excel prints in 1 line | Excel Discussion (Misc queries) | |||
Line chart in Excel - trendline incomplete | Charts and Charting in Excel | |||
Can you have a vertical line graph in Excel 2003 | Charts and Charting in Excel | |||
How do I delete every other line in an Excel document with over 3. | Excel Discussion (Misc queries) |