Results 1 to 4 of 4

If Then Statement help

Threaded View

  1. #1
    Registered User
    Join Date
    10-21-2013
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2013
    Posts
    4

    If Then Statement help

    I keep getting an error message for this function:

    Function Gear(RPM As Double, Gear1 As Double)
       If RPM >= 7200 And Gear1 = 1 Then
            Gear = 2
        If RPM >= 7200 And Gear1 = 2 Then
            Gear = 3
        If RPM >= 7200 And Gear1 = 3 Then
            Gear = 4
        If RPM >= 7200 And Gear1 = 4 Then
            Gear = 5
        If RPM >= 7200 And Gear1 = 5 Then
            Gear = 6
        If RPM >= 7200 And Gear1 = 6 Then
            Gear = 6
        Else
            Gear = Gear1
            
        End If
            
    End Function
    I'm not sure what's wrong with the function. Error says Block End If.
    Last edited by Fotis1991; 10-21-2013 at 08:28 AM. Reason: Pls use code tags around your code.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  2. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  3. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  4. Have question about using .find statement and brackets around After:= statement
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-09-2011, 03:28 PM
  5. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1