Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Message box question
I have a time sheet, the first six columns are headed as follows:
Hours Hours worked for company Start time End time A B C D 18:00 03:00 09:00 18:00 03:00 09:00 Having inserted the Start and End times, I need a message box to pop up and ask "which company to bill" and which ever is selected (by a option button) the total would be inserted on the correct cell of the row your working on. -- WH99 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Message box question
Why not try data Validation, assuming that you have a list of customers in
the sheet. Debra Dalgleish has great articles on Datathis subject. Start with: http://www.contextures.com/xlDataVal01.html Peter "WH99" wrote: I have a time sheet, the first six columns are headed as follows: Hours Hours worked for company Start time End time A B C D 18:00 03:00 09:00 18:00 03:00 09:00 Having inserted the Start and End times, I need a message box to pop up and ask "which company to bill" and which ever is selected (by a option button) the total would be inserted on the correct cell of the row your working on. -- WH99 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Message box question
Thanks Billy,
But I was after a vb code as I am using UserForms for this. -- WH99 "Billy Liddel" wrote: Why not try data Validation, assuming that you have a list of customers in the sheet. Debra Dalgleish has great articles on Datathis subject. Start with: http://www.contextures.com/xlDataVal01.html Peter "WH99" wrote: I have a time sheet, the first six columns are headed as follows: Hours Hours worked for company Start time End time A B C D 18:00 03:00 09:00 18:00 03:00 09:00 Having inserted the Start and End times, I need a message box to pop up and ask "which company to bill" and which ever is selected (by a option button) the total would be inserted on the correct cell of the row your working on. -- WH99 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Message box question
The idea is to add the option button to the form:
Set the Caption to "Which Company to Bill" and the Tab Index to zero. Set the the first option caption Co X, Name Opt X, TAb index 0. Repeat for each company The code goes in the Click button on the form. Private Sub OKButton_Click() ' make sure the correct sheet is active sheets("Sheet1").activate ' Determine the next empty row NextRow =application.worksheetfunction.Counta(Range("A:A") )+1 ' Transfer the rest of your data then If OptX then cells(nextrow, Column) = "X" if OptY then Cells(nextrow, Column) = "Y" if OptZ then Cells(nextrow,Column)= "Z" 'clear the controls for next entry ' Your code to clear other text boxes then OPtionUnkown = True firstTextBox.setfocus ' I think it was StartTime End Sub Can you work with this? Peter "WH99" wrote: Thanks Billy, But I was after a vb code as I am using UserForms for this. -- WH99 "Billy Liddel" wrote: Why not try data Validation, assuming that you have a list of customers in the sheet. Debra Dalgleish has great articles on Datathis subject. Start with: http://www.contextures.com/xlDataVal01.html Peter "WH99" wrote: I have a time sheet, the first six columns are headed as follows: Hours Hours worked for company Start time End time A B C D 18:00 03:00 09:00 18:00 03:00 09:00 Having inserted the Start and End times, I need a message box to pop up and ask "which company to bill" and which ever is selected (by a option button) the total would be inserted on the correct cell of the row your working on. -- WH99 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Message box question
I meant to say that Column is the column number that you want the company to
go, I guess 4 is appropriate? Peter "Billy Liddel" wrote: The idea is to add the option button to the form: Set the Caption to "Which Company to Bill" and the Tab Index to zero. Set the the first option caption Co X, Name Opt X, TAb index 0. Repeat for each company The code goes in the Click button on the form. Private Sub OKButton_Click() ' make sure the correct sheet is active sheets("Sheet1").activate ' Determine the next empty row NextRow =application.worksheetfunction.Counta(Range("A:A") )+1 ' Transfer the rest of your data then If OptX then cells(nextrow, Column) = "X" if OptY then Cells(nextrow, Column) = "Y" if OptZ then Cells(nextrow,Column)= "Z" 'clear the controls for next entry ' Your code to clear other text boxes then OPtionUnkown = True firstTextBox.setfocus ' I think it was StartTime End Sub Can you work with this? Peter "WH99" wrote: Thanks Billy, But I was after a vb code as I am using UserForms for this. -- WH99 "Billy Liddel" wrote: Why not try data Validation, assuming that you have a list of customers in the sheet. Debra Dalgleish has great articles on Datathis subject. Start with: http://www.contextures.com/xlDataVal01.html Peter "WH99" wrote: I have a time sheet, the first six columns are headed as follows: Hours Hours worked for company Start time End time A B C D 18:00 03:00 09:00 18:00 03:00 09:00 Having inserted the Start and End times, I need a message box to pop up and ask "which company to bill" and which ever is selected (by a option button) the total would be inserted on the correct cell of the row your working on. -- WH99 |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Message box question
Thanks Billy,
At the moment it looks good. Many thanks -- WH99 "Billy Liddel" wrote: I meant to say that Column is the column number that you want the company to go, I guess 4 is appropriate? Peter "Billy Liddel" wrote: The idea is to add the option button to the form: Set the Caption to "Which Company to Bill" and the Tab Index to zero. Set the the first option caption Co X, Name Opt X, TAb index 0. Repeat for each company The code goes in the Click button on the form. Private Sub OKButton_Click() ' make sure the correct sheet is active sheets("Sheet1").activate ' Determine the next empty row NextRow =application.worksheetfunction.Counta(Range("A:A") )+1 ' Transfer the rest of your data then If OptX then cells(nextrow, Column) = "X" if OptY then Cells(nextrow, Column) = "Y" if OptZ then Cells(nextrow,Column)= "Z" 'clear the controls for next entry ' Your code to clear other text boxes then OPtionUnkown = True firstTextBox.setfocus ' I think it was StartTime End Sub Can you work with this? Peter "WH99" wrote: Thanks Billy, But I was after a vb code as I am using UserForms for this. -- WH99 "Billy Liddel" wrote: Why not try data Validation, assuming that you have a list of customers in the sheet. Debra Dalgleish has great articles on Datathis subject. Start with: http://www.contextures.com/xlDataVal01.html Peter "WH99" wrote: I have a time sheet, the first six columns are headed as follows: Hours Hours worked for company Start time End time A B C D 18:00 03:00 09:00 18:00 03:00 09:00 Having inserted the Start and End times, I need a message box to pop up and ask "which company to bill" and which ever is selected (by a option button) the total would be inserted on the correct cell of the row your working on. -- WH99 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Message Box - Quick Question | Excel Discussion (Misc queries) | |||
Simple message box question | Excel Discussion (Misc queries) | |||
Simple message box question | Excel Discussion (Misc queries) | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
changing the message in an error message | Excel Worksheet Functions |