ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Message box question (https://www.excelbanter.com/excel-discussion-misc-queries/182453-message-box-question.html)

WH99

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

Billy Liddel

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


WH99

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


Billy Liddel

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


Billy Liddel

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


WH99

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



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com