Results 1 to 3 of 3

Compile Error - If, Then, Else, End IF Process

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    142

    Question Compile Error - If, Then, Else, End IF Process

    Hi All,

    A very simple one here I'm sure but I am getting this error every time I try and use an If function in VBA. I'd like to know the fundamental error of my ways!
    The Code is:

    
    If sPath = "C:\" Then sPathFName2 = sPath & FName2
    Else: sPathFName2 = sPath & "\" & FName2
    End If
    sPath, FName 2 and sPathFName2 are variables. sPath is the file path and FName 2 is the file name.
    Every time I try and run the above I get 'Compile Error: End If without Block If'

    Any help appreciated as always.
    Cheers,
    Mark
    Last edited by R_S_6; 08-17-2010 at 08:34 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