Message box question

W

WH99

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.
 
B

Billy Liddel

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
 
B

Billy Liddel

I meant to say that Column is the column number that you want the company to
go, I guess 4 is appropriate?

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top