# Clockface and angles

#### hemsleysut

##### Board Regular
I'd like to design a clockface with an hour and minute hands and the user can move the hands and the angle between them is returned eg 3 o'clock would return 45degrees. Any ideas how to proceed.

### Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

##### Well-known Member
Hello,

Very interesting question.

Have got code working out the angle of two lines but I can't seem to get it above 90 degrees, will have a look on Moday as I am about to go home now.

Code:
``````Sub Macro4()
ActiveSheet.Shapes("Line 2").Select
HOR = Selection.ShapeRange.Item("Line 2").Width
VER = Selection.ShapeRange.Item("Line 2").Height
If HOR = 0 Then
SECOND_ANGLE = 0
Else
If VER = 0 Then
SECOND_ANGLE = 90
Else
SECOND_ANGLE = Atn(VER / HOR) * 180 / 3.1415927
End If
End If

ActiveSheet.Shapes("Line 1").Select
H_VER = Selection.ShapeRange.Item("Line 1").Width
H_HOR = Selection.ShapeRange.Item("Line 1").Height
If H_HOR = 0 Then
HOUR_ANGLE = 0
Else
If H_VER = 0 Then
HOUR_ANGLE = 90
Else
HOUR_ANGLE = Atn(VER / HOR) * 180 / 3.1415927
End If
End If
End Sub``````

Replies
5
Views
272
Replies
2
Views
85
Replies
1
Views
138
Replies
12
Views
266
Replies
6
Views
286

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,152,095
Messages
5,768,054
Members
425,451
Latest member
JohnBrooksBiddle

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back