mtroche
Civil/Environmental
- Jun 4, 2001
- 39
Below is the program tied to a userform in EXCEL. The userform is used to get the desired clearence below a powerline and the place from the lowest pole where the desired clearance will be calculated. The problem is that the span is 25 meters long and I can't calculate the clearance at the these places (from 3 to 9 meters from the lowest pole) because the following message comes:
"The Distance from the Lowest Pole where the Sag will be Calculated shall be Smaller than or Equal to " & Worksheets("TSag Net"
.range("e3"
, _
vbInformation, "Check"
Of course I have checked the value in Worksheets("TSag Net"
.range("e3"
and this is the correct one -- "25".
I have no idea why this is occuring... Any help will be very usefull. Thank you for the help you can give me.
Private Sub Calculate_Click()
TodoLlenoTension = 0
If IsNumeric(TensionSag) = False Then
MsgBox "Check the Desired Sag.", _
vbInformation, "Check"
ElseIf TensionSag < 0 Then
MsgBox "The Sag Value shall be Positive.", _
vbInformation, "Check"
ElseIf TensionDistance <> "At the Lowest Point" And _
IsNumeric(TensionDistance) = False Then
MsgBox "Check the Distance from the Lowest Pole where the Sag will be Calculated.", _
vbInformation, "Check"
ElseIf IsNumeric(TensionDistance) = True And TensionDistance < 0 Then
MsgBox "The Distance from the Lowest Pole to the Sag shall be Positive.", _
vbInformation, "Check"
ElseIf IsNumeric(TensionDistance) = True And TensionDistance > Worksheets("TSag Net"
.range("e3"
Then
MsgBox "The Distance from the Lowest Pole where the Sag will be Calculated shall be Smaller than or Equal to " & Worksheets("TSag Net"
.range("e3"
, _
vbInformation, "Check"
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Else: TodoLlenoTension = 1
End If
If TodoLlenoTension = 1 Then
Me.Hide
StartTime = Timer
Worksheets("PoleData"
.Cells(2, 10) = TensionSag
Worksheets("(TSag)2"
.Activate
'XXXXXX COTEJA AQUI XXXXXX
If TensionDistance <> "At the Lowest Point" Then
Worksheets("(TSag)2"
.range("ap30"
= TensionDistance * 3.28
Sheet6.Iterating_For_ClearanceB
Else
Worksheets("(TSag)2"
.range("ap30"
= ""
Sheet6.Iterating_For_Clearance
End If
'XXXXXX COTEJA AQUÏ XXXXXX
EndTime = Timer
Worksheets("(TSag)2"
.range("ar30"
= Format(EndTime - StartTime, "0.0"
Tension.Caption = Worksheets("(TSag)2"
.range("x15"
& " Lbs"
ElapsedTime.Caption = Worksheets("(TSag)2"
.range("ar30"
& " segs"
UserFormTension.Show
End If
End Sub
"The Distance from the Lowest Pole where the Sag will be Calculated shall be Smaller than or Equal to " & Worksheets("TSag Net"
vbInformation, "Check"
Of course I have checked the value in Worksheets("TSag Net"
I have no idea why this is occuring... Any help will be very usefull. Thank you for the help you can give me.
Private Sub Calculate_Click()
TodoLlenoTension = 0
If IsNumeric(TensionSag) = False Then
MsgBox "Check the Desired Sag.", _
vbInformation, "Check"
ElseIf TensionSag < 0 Then
MsgBox "The Sag Value shall be Positive.", _
vbInformation, "Check"
ElseIf TensionDistance <> "At the Lowest Point" And _
IsNumeric(TensionDistance) = False Then
MsgBox "Check the Distance from the Lowest Pole where the Sag will be Calculated.", _
vbInformation, "Check"
ElseIf IsNumeric(TensionDistance) = True And TensionDistance < 0 Then
MsgBox "The Distance from the Lowest Pole to the Sag shall be Positive.", _
vbInformation, "Check"
ElseIf IsNumeric(TensionDistance) = True And TensionDistance > Worksheets("TSag Net"
MsgBox "The Distance from the Lowest Pole where the Sag will be Calculated shall be Smaller than or Equal to " & Worksheets("TSag Net"
vbInformation, "Check"
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Else: TodoLlenoTension = 1
End If
If TodoLlenoTension = 1 Then
Me.Hide
StartTime = Timer
Worksheets("PoleData"
Worksheets("(TSag)2"
'XXXXXX COTEJA AQUI XXXXXX
If TensionDistance <> "At the Lowest Point" Then
Worksheets("(TSag)2"
Sheet6.Iterating_For_ClearanceB
Else
Worksheets("(TSag)2"
Sheet6.Iterating_For_Clearance
End If
'XXXXXX COTEJA AQUÏ XXXXXX
EndTime = Timer
Worksheets("(TSag)2"
Tension.Caption = Worksheets("(TSag)2"
ElapsedTime.Caption = Worksheets("(TSag)2"
UserFormTension.Show
End If
End Sub