开发者

excel vba autopopulate textbox

开发者 https://www.devze.com 2023-03-08 16:08 出处:网络
got another question. I have a few forms set up for my client and some of the data is needed on more than one form. The user will input a client name and client id on the client tab. When they open a

got another question. I have a few forms set up for my client and some of the data is needed on more than one form. The user will input a client name and client id on the client tab. When they open a new form to enter financial info I have a combobox with the newly created client names and would love to have the client id automatically show up based on th开发者_如何学Goe client name. I have used a combobox where i put in a range in the rowsource and then set the bound column to match the client id. But you still have to choose the correct client id.

So is there a way I can simply have the client id filter into the box upon selection of the client name? I am not showing code on this b/c I can't really figure where to start and I am def no VB master

As always...Thanks a ton!


You should be able to do this without VB code in the following way. On the client sheet have two columns side by side. Looking like

Client Name      Client ID
===========================
IBM                 1
HP                  2
Microsoft           3

Now, on the next sheet, drag a combobox from the Developer tab. Insert a Form Control ComboBox, do not pick an ActiveX ComboBox. Right click on the ComboBox. Select Format Control. Got to the Control Tab. For Input Range, select the 2 column range on the Client Sheet (i.e. from IBM to 3). For Cell Link, select a result cell.

Now, your ComboBox should list IBM, HP, Microsoft. When you select an item the Cell Link should display the corresponding Client ID.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号