ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Choose Invoice# fills Userform again (https://www.excelbanter.com/excel-programming/328421-choose-invoice-fills-userform-again.html)

Jennifer

Choose Invoice# fills Userform again
 
Patrick gave me a great code that allows me to have a user form were the
invoice# is choosen via combo box then the macro uses that invoice number to
fill the text boxes. Price Boxes Purchased etc. Problem arrises because
there can be more than one entry of an invoice number.
eg. 1001
1001
1002
1003
1003
The only thing in the database sheet that may never have duplicates is the
assigned index number. But I really need the user to have the option of
choosing the invoice. The only idea I know of would be to have another column
that concantenates the two (index & invoice) and have them choose that. Does
anyone have any other help? Thank you The following is the code Patrick gave
me.
Private Sub cboInvoice_Change()
RowNumber = cboInvoice.ListIndex + 2
ShowValue cboInvoice
End Sub

Private Sub UserForm_Initialize()

With Worksheets("ProduceData")
LastRow = .Range("b2").End(xlDown).Row
RowNumber = cboInvoice.ListIndex + 2
End With
End Sub
--
Though daily learning, I LOVE EXCEL!
Jennifer

Jennifer

Choose Invoice# fills Userform again
 
Never Mind- I just concantenated them to make a unique invoice number.
Thanks.Jennifer
--
Though daily learning, I LOVE EXCEL!
Jennifer


"Jennifer" wrote:

Patrick gave me a great code that allows me to have a user form were the
invoice# is choosen via combo box then the macro uses that invoice number to
fill the text boxes. Price Boxes Purchased etc. Problem arrises because
there can be more than one entry of an invoice number.
eg. 1001
1001
1002
1003
1003
The only thing in the database sheet that may never have duplicates is the
assigned index number. But I really need the user to have the option of
choosing the invoice. The only idea I know of would be to have another column
that concantenates the two (index & invoice) and have them choose that. Does
anyone have any other help? Thank you The following is the code Patrick gave
me.
Private Sub cboInvoice_Change()
RowNumber = cboInvoice.ListIndex + 2
ShowValue cboInvoice
End Sub

Private Sub UserForm_Initialize()

With Worksheets("ProduceData")
LastRow = .Range("b2").End(xlDown).Row
RowNumber = cboInvoice.ListIndex + 2
End With
End Sub
--
Though daily learning, I LOVE EXCEL!
Jennifer


Tom Ogilvy

Choose Invoice# fills Userform again
 
But the code Patrick gave you did not depend on what Invoice number was
chosen. (It would be unclear how the user would differentiate however).

--
Regards,
Tom Ogilvy

"Jennifer" wrote in message
...
Never Mind- I just concantenated them to make a unique invoice number.
Thanks.Jennifer
--
Though daily learning, I LOVE EXCEL!
Jennifer


"Jennifer" wrote:

Patrick gave me a great code that allows me to have a user form were

the
invoice# is choosen via combo box then the macro uses that invoice

number to
fill the text boxes. Price Boxes Purchased etc. Problem arrises

because
there can be more than one entry of an invoice number.
eg. 1001
1001
1002
1003
1003
The only thing in the database sheet that may never have duplicates is

the
assigned index number. But I really need the user to have the option of
choosing the invoice. The only idea I know of would be to have another

column
that concantenates the two (index & invoice) and have them choose that.

Does
anyone have any other help? Thank you The following is the code Patrick

gave
me.
Private Sub cboInvoice_Change()
RowNumber = cboInvoice.ListIndex + 2
ShowValue cboInvoice
End Sub

Private Sub UserForm_Initialize()

With Worksheets("ProduceData")
LastRow = .Range("b2").End(xlDown).Row
RowNumber = cboInvoice.ListIndex + 2
End With
End Sub
--
Though daily learning, I LOVE EXCEL!
Jennifer





All times are GMT +1. The time now is 07:20 PM.

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