Results 1 to 10 of 10

Explain Syntax Error

Threaded View

  1. #1
    Registered User
    Join Date
    10-12-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    76

    Explain Syntax Error

    Please can you advice where i'm going wrong.

    my IF statement is breaking logic in picking the right strcode value.
    Can u please advice whats wrong with this syntax?

    I have also attached a worksheet to explain the problem

    My code is below

    If strOnG8 = "Yes" and Range(RangeFinder("A") + strCurrentRow).Value2  Then
                strcode = "Asia"
        ElseIf strOnH8 = "Yes" and Range(RangeFinder("B") + strCurrentRow).Value2  Then
                strcode = "Africa"
        ElseIf strOnI8 = "Yes" and Range(RangeFinder("C") + strCurrentRow).Value2  Then
                strcode = "S America"
        ElseIf strOnJ8 = "Yes" and Range(RangeFinder("D") + strCurrentRow).Value2  Then
                strcode = "Australia"
    End If
     
    If strOnG8 = "No" and Range(RangeFinder("A") + strCurrentRow).Value2 Then
                strcode = "N America"
        ElseIf strOnH8 = "No" and Range(RangeFinder("B") + strCurrentRow).Value2  Then
                strcode = "Europe"
        ElseIf strOnI8 = "No" and Range(RangeFinder("C") + strCurrentRow).Value2  Then
                strcode = "Antartica"
        ElseIf strOnJ8 = "No" and Range(RangeFinder("D") + strCurrentRow).Value2  Then
                strcode = "No more continents to choose"
    End If
     
    'RangeFinder and strcode are range and string variables respectively pulled from another function in my sheet and they are all working fine. There is no dependency 
    of them to the above code
    Attached Files Attached Files
    Last edited by captedgar; 02-08-2010 at 09:14 AM.

Thread Information

Users Browsing this Thread

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

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