Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Userform code problem (excel 2003)

    Hi

    I am trying to learn how to create userforms, the If IsEmpty line is red and I can't work out why

    Private Sub cmdOK_Click()
    ActiveWorkbook.Sheets("Course Bookings").Activate
    Range("A1").Select
    Do
    If IsEmpty(ActiveCell) = FalseThen <------ (this line is red)
    ActiveCell.Offset(1, 0).Select
    End If
    Loop Until IsEmpty(ActiveCell) = True
    ActiveCell.Value = txtName.Value
    ActiveCell.Offset(0, 1) = txtPhone.Value
    ActiveCell.Offset(0, 2) = cboDepartment.Value
    ActiveCell.Offset(0, 3) = cboCourse.Value
    If optIntroduction = True Then
    ActiveCell.Offset(0, 4).Value = "Intro"
    ElseIf optIntermediate = True Then
    ActiveCell.Offset(0, 4).Value = "Intermed"
    Else
    ActiveCell.Offset(0, 4).Value = "Adv"
    End If
    If chkLunch = True Then
    ActiveCell.Offset(0, 5).Value = "Yes"
    Else
    ActiveCell.Offset(0, 5).Value = "No"
    End If
    If chkVegetarian = True Then
    ActiveCell.Offset(0, 6).Value = "Yes"
    Else
    If chkLunch = False Then
    ActiveCell.Offset(0, 6).Value = ""
    Else
    ActiveCell.Offset(0, 6).Value = "No"
    End If
    End If
    Range("A1").Select
    End Sub

    Many Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Userform code problem (excel 2003)

    There is no space between False and Then.

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Userform code problem (excel 2003)

    Hi Hans

    There is an expression ' Sometimes you can't see the woods for the trees'

    Once again I am in your debt.

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

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