VBA Program

write a VBA program to save the details while booking a flight. 


I am done with my code but unable to run that code.


Private Sub AdultSpinButton_Change()

AdultTextBox.Text = AdultSpinButton.Value

End Sub


Private Sub BookCommandButton_Click()

Application.ScreenUpdating = False

Dim NewemptyRow As Long


NewemptyRow = WorksheetFunction.CountA(Range(“A:A”)) + 1

Cells(NewemptyRow, 1).Value = NameTextBox.Value

Cells(NewemptyRow, 2).Value = MobileComboBox.Value

If RoundOptionButton.Value = True Then

    Cells(NewemptyRow, 3).Value = “Round Trip”


    Cells(NewemptyRow, 3).Value = “One Way”

End If


Cells(NewemptyRow, 4).Value = FormComboBox.Value


Cells(NewemptyRow, 5).Value = ToComboBox.Value


Cells(NewemptyRow, 6).Value = DepartComboBox.Value


Cells(NewemptyRow, 7).Value = ReturnComboBox.Value


Cells(NewemptyRow, 8).Value = AdultTextBox.Value


Cells(NewemptyRow, 9).Value = ChildTextBox.Value


If StudentOptionButton.Value = True Then

    Cells(NewemptyRow, 10).Value = “Student”


    Cells(NewemptyRow, 10).Value = “Armed Forces”


    Cells(NewemptyRow, 10).Value = “Sr.Citizen”

End If


Cells(NewemptyRow, 11).Value = PromoTextBox.Value


Cells(NewemptyRow, 12).Value = CurrencyComboBox.Value




Unload Me


Application.ScreenUpdating = True


End Sub


Private Sub CancelCommandButton_Click()

Unload Me

End Sub


Private Sub ChildSpinButton_Change()

ChildTextBox.Text = ChildSpinButton.Value

End Sub


Private Sub ClearCommandButton_Click()

Call Userform_Initialize

End Sub

Private Sub Userform_Initialize()

NameTextBox = ” “

MobileTextBox = ” “

RoundOptionButton.Value = False

OnewayOptionButton.Value = False

With FomComboBox

     .AddItem “Delhi”

     .AddItem “Hyderabad”

     .AddItem “Mumbai”

     .AddItem “Bangalore”

     .AddItem “Pune”

     .AddItem “Chennai”

     .AddItem “Kolkata”

     .AddItem “Lucknow”

End With


With ToComboBox

     .AddItem “Delhi”

     .AddItem “Hyderabad”

     .AddItem “Mumbai”

     .AddItem “Bangalore”

     .AddItem “Pune”

     .AddItem “Chennai”

     .AddItem “Kolkata”

     .AddItem “Lucknow”

End With


With DepartComboBox

     .AddItem “1/month(today())/year(today())”

     .AddItem “2/month(today())/year(today())”

     .AddItem “3/month(today())/year(today())”

     .AddItem “4/month(today())/year(today())”

     .AddItem “5/month(today())/year(today())”

     .AddItem “6/month(today())/year(today())”

End With


AdultTextBox.Value = ” “


ChildTextBox.Value = ” “


StudentOptionButton.Value = False

ArmedOptionButton.Value = False

SrCitizenOptionButton.Value = False

PromoTextBox = ” “


With CurrencyComboBox

     .AddItem “Indian Rupees”

     .AddItem “US Dollars”

End With

End Sub


“CommandButton Code”

Private Sub BookFlight_Click()


End Sub



when I click on the command button It gives me runtime error 424 “Object required”, I am not able to debug my problem, can anyone help me with that.

By: Prabhav Sharma

69 thoughts on “VBA Program

  1. Trenbolone hexa kaufen

    Magnificent goods from you, man. I have take into account your stuff prior to and you’re simply extremely great. I actually like what you’ve received here, certainly like what you’re stating and the way by which you assert it. You make it entertaining and you continue to care for to stay it sensible. I can not wait to read much more from you. This is really a terrific site.

  2. yeezy boost

    I wanted to send a brief comment to thank you for all of the great recommendations you are sharing here. My incredibly long internet investigation has finally been rewarded with good quality facts to write about with my two friends. I ‘d suppose that many of us site visitors actually are unequivocally fortunate to exist in a fine community with so many wonderful professionals with very beneficial tips and hints. I feel really privileged to have discovered your entire web page and look forward to plenty of more fabulous minutes reading here. Thanks once again for all the details.

  3. Acquistare Reductil in linea

    Good day I am so thrilled I found your weblog, I really found you by error, while I was searching on Askjeeve for something else, Nonetheless I am here now and would just like to say kudos for a tremendous post and a all round interesting blog (I also love the theme/design), I don’t have time to browse it all at the minute but I have bookmarked it and also added your RSS feeds, so when I have time I will be back to read much more, Please do keep up the excellent job.

  4. Melanotan 2 kaufen

    I like what you guys are up also. Such clever work and reporting! Carry on the superb works guys I’ve incorporated you guys to my blogroll. I think it will improve the value of my website 🙂

  5. Buy Sibutril Online

    This blog is definitely rather handy since I’m at the moment creating an internet floral website – although I am only starting out therefore it’s really fairly small, nothing like this site. Can link to a few of the posts here as they are quite. Thanks much. Zoey Olsen

  6. air jordan

    I have to point out my respect for your generosity for those individuals that should have guidance on that field. Your personal commitment to passing the message all through ended up being remarkably practical and have regularly enabled associates just like me to attain their pursuits. This warm and friendly help indicates a whole lot to me and even more to my fellow workers. Thank you; from each one of us.

  7. acheter steroides en ligne

    It’s a shame you don’t have a donate button! I’d definitely donate to this outstanding blog! I suppose for now i’ll settle for book-marking and adding your RSS feed to my Google account. I look forward to brand new updates and will talk about this blog with my Facebook group. Talk soon!

  8. in Deutschland

    Hi, Neat post. There’s a problem with your web site in internet explorer, would test this… IE still is the market leader and a huge portion of people will miss your excellent writing because of this problem.

  9. ig

    Hey There. I found your blog using msn. This is a very
    well written article. I’ll make sure to bookmark it and come back
    to read more of your useful info. Thanks for the post.

    I’ll certainly comeback.

  10. bad religion tour

    Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You definitely know what youre talking about, why waste your intelligence on just posting videos to your site when you could be giving us something enlightening to read?

Comments are closed.