ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA - how do I pass info from dropdown list to a string?? (https://www.excelbanter.com/excel-programming/442920-vba-how-do-i-pass-info-dropdown-list-string.html)

SNA400

VBA - how do I pass info from dropdown list to a string??
 
Hi All

I am sure it's me being dumb, but I need to do the following - but cannot
think how to do it.

I have a VBA form with a linked dropdown box to some vehicle registrations.
Within this form i want the user to be able to change a dedicated vehicle
registration, which is on the dropdown, to one that the user can enter.

Can I do the following - get the registration selected in the dropdown into
a vbstring and use the code below to change it to the new registration

cboOldVehicle is the Vehicle in the dropdowm
txtNewVehicle is the replacement vehicle

Worksheets("VPC").Columns("D").Replace What:=cboOldVehicle,
Replacement:=txtNewVehicle, SearchOrder:=xlByColumns, MatchCase:=True

Any help in this would be appreciated!!

Don Guillett[_2_]

VBA - how do I pass info from dropdown list to a string??
 
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SNA400" wrote in message
...
Hi All

I am sure it's me being dumb, but I need to do the following - but cannot
think how to do it.

I have a VBA form with a linked dropdown box to some vehicle
registrations.
Within this form i want the user to be able to change a dedicated vehicle
registration, which is on the dropdown, to one that the user can enter.

Can I do the following - get the registration selected in the dropdown
into
a vbstring and use the code below to change it to the new registration

cboOldVehicle is the Vehicle in the dropdowm
txtNewVehicle is the replacement vehicle

Worksheets("VPC").Columns("D").Replace What:=cboOldVehicle,
Replacement:=txtNewVehicle, SearchOrder:=xlByColumns, MatchCase:=True

Any help in this would be appreciated!!




All times are GMT +1. The time now is 09:12 PM.

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