View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
KrisB_bacon KrisB_bacon is offline
external usenet poster
 
Posts: 1
Default data from combo box in userform to spreasheet???? URGENT!!

Look at the attached spreadsheet (scalled down, unfinished, just look a
the worksheets, Classes and Fieldtrips, and the button in fieldtrips)
The purpose of the two worksheets in question is to allow a schoo
geography teacher to input if there is a fieldtrip this year (wateve
year it is, 2003 to 2008). The classes worksheet holds the data, th
fieldtrips worksheet stores the summary.

In the fieldtrips tab, the user would click the button on the rite
This takes them to a userform. They select which year the fieldtrip i
and click 1 of two buttons, Yes or No. Yes takes them to the Classe
worksheet and tells them to input appropriate data. No again takes the
to the Classes worksheet and formats the appropriate column, statin
that there is no fieldtrip in that year. Before they are taken there
the macro puts a Yes or No in cell C2 and the year that is selecte
into B2. That worked fine. But to make it easier I have filled out th
years, ready for the Yes or No to be placed. However, I can't work ou
how to get the year (whatever year the user selects) into th
appropriate cell. Can I use check boxes, option buttons etc.?

Below is the code for the Yes button:

Private Sub CommandButton1_Click()
UserForm.Hide
Range("C3").Select
ActiveCell.FormulaR1C1 = "Yes"
Sheets("Classes").Select
MsgBox "Please now enter pupil attendance on the fieldtrip under th
selected year", vbOKOnly + vbExclamation, "Important!"
Unload UserForm
End Sub


Below is the code for the No button:

Private Sub CommandButton2_Click()
UserForm.Hide
Range("C3").Select
ActiveCell.FormulaR1C1 = "No"
Sheets("Classes").Select
Load UserForm3
UserForm3.Show
Unload UserForm3
Unload UserForm
End Sub

Don't worry about the UserForm3, that is another story

So.......any ideas of how can I solve this problem.


Thx to any people who reply


Chri

Attachment filename: geo system3 (min).xls
Download attachment: http://www.excelforum.com/attachment.php?postid=39437
--
Message posted from http://www.ExcelForum.com