LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Mutiple comboboxes on user form

Hey everybody:

I am sort of new to this whole VBA thing and I am self teaching my self
everything through the discussion groups so thank you all for writing
different thing for us to read.

the main reason for this post is that I am trying to make a spreadsheet that
utilizes a user form to enter the data. I have never worked with combo boxes
before and have two in my form. I have all the data in the drop downs - one
has the date and the other has the time that we will be offering a certain
service. I am trying to code something that would make it look at the spread
sheet for the date selected and the time (both selected from dropdowns) but
if the time was taken it shows an error message. If the date and time were
both available it would then copy info from textboxes into the spreadsheet.
here is what my code currently looks like:

Private Sub Submit_Click()
If ComboBox1.Value = ("November 21st") And ComboBox2.Value = ("8:00pm")
Then ActiveWorkbook.Sheets("November 21").Activate
Range("B5").Select
Private Sub Place_Info()
If IsEmpty(ActiveCell) = False Then
ActiveWorkbook.Sheets("Main").Activate
Error.Show
End If
If IsEmpty(ActiveCell) = True Then
ActiveCell.Value = TextBox1.Value
ActiveCell.Offset(0, 1) = TextBox2.Value
ActiveCell.Offset(0, 2) = TextBox3.Value
ActiveCell.Offset(0, 3) = TextBox4.Value
ActiveCell.Offset(0, 4) = TextBox5.Value
ActiveCell.Offset(0, 5) = TextBox6.Value
End If
If ComboBox1.Value = ("November 21st") And ComboBox2.Value = ("8:20pm")
Then ActiveWorkbook.Sheets("November 21").Activate
Range("B6").Select
Private Sub Place_Info()
If IsEmpty(ActiveCell) = False Then
ActiveWorkbook.Sheets("Main").Activate
Error.Show
End If
If IsEmpty(ActiveCell) = True Then
ActiveCell.Value = TextBox1.Value
ActiveCell.Offset(0, 1) = TextBox2.Value
ActiveCell.Offset(0, 2) = TextBox3.Value
ActiveCell.Offset(0, 3) = TextBox4.Value
ActiveCell.Offset(0, 4) = TextBox5.Value
ActiveCell.Offset(0, 5) = TextBox6.Value
End If

End Sub

--So what it is doing is just reading straight through everything and not
doing each combo box time as specified. I hope this all makes since and
someone can assist me!


Thanks so much!

~Patrick

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running mutiple excel sheets on mutiple computers Lost Excel Discussion (Misc queries) 3 January 16th 09 12:32 AM
Date field in user form & Loading a user form on opening workbook Balan Excel Programming 1 May 24th 08 03:40 PM
Mutiple user edits Chris York[_2_] Excel Discussion (Misc queries) 0 January 23rd 08 02:16 AM
Excel 2007 User defined fucntion, cannot paste in mutiple cells J Wallace Excel Programming 0 November 13th 07 09:05 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM


All times are GMT +1. The time now is 05:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"