# 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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

##### 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
0
Views
266
Replies
5
Views
372
Replies
1
Views
160
Replies
8
Views
868
Replies
3
Views
506

1,187,178
Messages
5,962,051
Members
438,578
Latest member
MrJimC

### 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