×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

[color #ff0000]Problems with IF.. .Then

[color #ff0000]Problems with IF.. .Then

[color #ff0000]Problems with IF.. .Then

(OP)
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

RE: [color #ff0000]Problems with IF.. .Then

mtroche,

I notice this is a second posting of this question, with no replies to your original post.  I would be happy to take a look at this workbook if this is OK with you.  If so, be sure the data producing the problem is in place, and send to me at rmikesmith@earthlink.net


Regards,
Mike

RE: [color #ff0000]Problems with IF.. .Then

(OP)
Hi, MSmith:

Thanks for requesting my posting, but I have already fixed the problem...  It should be a "bug" in EXCEL.  Everything is Bullet Proof until the gun fires!!  
  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources