cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to save value of a listbox from an Excel Table?

ptc-4323006
1-Newbie

How to save value of a listbox from an Excel Table?

I created a list box that can read values from an excel sheet.

By choosing different value on the listbox, the factor I need will change accordingly.

However, I can not save the value of the listbox, every time I close and re-open the MathCAD sheet, the listbox will go back to the first row.

I have been reading the posts on this website, a lot of people got simliar question of making custom controls persistent and there are answers for them. However, I guess since the values of the listbox I used is from the Excel table, the case is a little bit different.

Unfortunately, I am not good at VB at all, so if you can help me fix the script diretly, that will be perfect.

I attached the MathCAD file and the Excel table below. Please help me out with this.

Thank you very much!!!

1 ACCEPTED SOLUTION

Accepted Solutions

In fact I've done it for you. Have a look at the attached. When it was saved I had selected the value 3.

Mike

View solution in original post

7 REPLIES 7
MikeArmstrong
5-Regular Member
(To:ptc-4323006)

Have a look at the attached worksheet and see if you can adapt it to your needs.

Mike

Welcome to the forum by the way

Mike

Hi, Mike:

Thanks for your quick response.

I tried this one this morning. It seems not working .

I guess the reason is the listbox in this sheet is from textstrings instead of reading from an table.

Thanks,

Jiabao

MikeArmstrong
5-Regular Member
(To:ptc-4323006)

The only difference is that I have manually put the text into the list box.

Mike

In fact I've done it for you. Have a look at the attached. When it was saved I had selected the value 3.

Mike

wow~ I am so surprised.

I tried almost 2 hours this morning and you did it in 5 minutes (or even less)!

It seems your listbox is not really relate to the table value, but with the define of the Iw factor, it linked back to the table. Maybe that is what failed me .

I will do some research to this.

Thank you very much again!

MikeArmstrong
5-Regular Member
(To:ptc-4323006)

I tried almost 2 hours this morning and you did it in 5 minutes (or even less)!

I never wrote this sheet, I just had it in my collection.

It seems your listbox is not really relate to the table value, but with the define of the Iw factor, it linked back to the table. Maybe that is what failed me .

The listbox is essentially returning a value, it doesn't really have to relate to the table. Just incorporate the section in your listbox where the data is collected to be displayed.

Cheers

Mike

Top Tags