this is a routine which makes a pointer turn around according to what angle is set by the user.
When it goes to run it comes up with a runtime error 5. It used to work a few years ago but now it comes up with this error.
The first macro listed below calls the second one up:
Sub angulartilt()
Call Sheet1.tilt35
Z = Range("tilt30").Value
d = 19000
l = Int(Z)
With ActiveSheet.Shapes("panelangle")
For w = 1 To l
.IncrementRotation 1
DoEvents
For zz = 1 To n
l = zz
Next
Next
End With
End Sub
this is name sheet1.tilt35
Option Explicit
Sub tilt35()
Dim myShape As Shape
Set myShape = ActiveSheet.Shapes("panelangle")
myShape.IncrementRotation 45
myShape.Rotation = 0
End Sub
Sub testme()
Dim myShape As Shape
Set myShape = ActiveSheet.Shapes("Pointer1")
myShape.IncrementRotation 45
myShape.Rotation = 0
End Sub
Private Sub Worksheet_Activate()
Sheets("PV Calculator").Unprotect
Rows(9).Hidden = Range("GB12").Value = 1
Sheets("PV Calculator").Protect
End Sub
Private Sub worksheet_selectionChange(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If .Address(False, False) = "C18" Then _
Range("C19").ClearContents
End With
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$C$13" Then
Select Case Target.Value
Case Is > 0: RotateShape
Case Else: testme
End Select
End If
End Sub
When it goes to run it comes up with a runtime error 5. It used to work a few years ago but now it comes up with this error.
The first macro listed below calls the second one up:
Sub angulartilt()
Call Sheet1.tilt35
Z = Range("tilt30").Value
d = 19000
l = Int(Z)
With ActiveSheet.Shapes("panelangle")
For w = 1 To l
.IncrementRotation 1
DoEvents
For zz = 1 To n
l = zz
Next
Next
End With
End Sub
this is name sheet1.tilt35
Option Explicit
Sub tilt35()
Dim myShape As Shape
Set myShape = ActiveSheet.Shapes("panelangle")
myShape.IncrementRotation 45
myShape.Rotation = 0
End Sub
Sub testme()
Dim myShape As Shape
Set myShape = ActiveSheet.Shapes("Pointer1")
myShape.IncrementRotation 45
myShape.Rotation = 0
End Sub
Private Sub Worksheet_Activate()
Sheets("PV Calculator").Unprotect
Rows(9).Hidden = Range("GB12").Value = 1
Sheets("PV Calculator").Protect
End Sub
Private Sub worksheet_selectionChange(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If .Address(False, False) = "C18" Then _
Range("C19").ClearContents
End With
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$C$13" Then
Select Case Target.Value
Case Is > 0: RotateShape
Case Else: testme
End Select
End If
End Sub