ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User Form (https://www.excelbanter.com/excel-programming/331197-user-form.html)

Alro

User Form
 
I have a multipage userform (8 pages)that will have 12 questions on
each with a yes/no chkbox. Each chkbox is named yes1, yes2 etc.

When a user ticks yes, a value of 1 is added onto a hidden sheet named
"Chart".

Now the problem is once I close the workbook the previous ticks are
gone. I use me.hide and this works while the workbook is open.

How do I reference the previous state of the userform?

First post and just new to the excel experience.

Thanks

Allan


Patrick Molloy[_2_]

User Form
 
Assuming that you save the workbook, all you need to do is read the data from
the sheet when th euserform is initialised...if your check boxes are linked
to th ecells, then this will be automatic.
If you're not saving the workbook, then you need to export the results so
that they can be read back when the workbook is re-opened.

"Alro" wrote:

I have a multipage userform (8 pages)that will have 12 questions on
each with a yes/no chkbox. Each chkbox is named yes1, yes2 etc.

When a user ticks yes, a value of 1 is added onto a hidden sheet named
"Chart".

Now the problem is once I close the workbook the previous ticks are
gone. I use me.hide and this works while the workbook is open.

How do I reference the previous state of the userform?

First post and just new to the excel experience.

Thanks

Allan



excelthoughts

User Form
 
Hi Allan,

When you reopen the file, you could repopulate the UserForm by looking
at the values that you have saved on the "chart" sheet.

i.e. something like
if cell.value=1 then
chkbox.value=true
else
chkbox.value=false
end if

You would need some logic here to connect the names of the chkboxes and
the location of the "1" cells on the chart sheet.

Regards
Andrew
excelthoughts.com


Alro

User Form
 

How do I link the cells?


Alro

User Form
 
Thanks for helping. I'm on the right track now I think.



All times are GMT +1. The time now is 02:37 PM.

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