Shortz
11-29-2010, 05:00 AM
Hi everyone,
thanks in advance and down to business,
I've got a workbook and a userform in that workbook (Excel 2003) that will print certain number of sheets depending on the user's selection. That bit i can code fine. The user also inputs in some project information which is added / updated to certain parts of each sheet depending on the sheet.
My current problem is the updating of these sheets when the user inputs amended information into the userform. The problem i've been having is with sheets where the changes are made to textboxes and labels. cells update fine.
For example,
1. user inputs "I am awesome" into the userform, hits print (and makes selections) and all sheets update and print correctly.
2. the user then changes the userform information to "I am extremely awesome" and all the sheets update and print correctly except where the info is being put into textboxes or labels (they still retain the previous "i am awesome"). If you then hide the userform and go do each sheet manually (the ones with the textboxes & labels), the information is now correct.
I know this has something to do with the screen updating, i just can't figure out how to force the textboxes and labels to update BEFORE it is printed.
I've experimented with turning on screenupdating = true before the code to update the textboxes but that doesn't seem to work.
any help would be much appreciated.
An eg of the code i'm using is below
sheets(1).textbox1.value = userform1.projectinfo.value
sheets(1).label1.caption= userform1.projectnumber.value
the code below will update fine prior to printing
sheets(1).cells(1,1).value = userform1.projectinfo.value
thanks in advance and down to business,
I've got a workbook and a userform in that workbook (Excel 2003) that will print certain number of sheets depending on the user's selection. That bit i can code fine. The user also inputs in some project information which is added / updated to certain parts of each sheet depending on the sheet.
My current problem is the updating of these sheets when the user inputs amended information into the userform. The problem i've been having is with sheets where the changes are made to textboxes and labels. cells update fine.
For example,
1. user inputs "I am awesome" into the userform, hits print (and makes selections) and all sheets update and print correctly.
2. the user then changes the userform information to "I am extremely awesome" and all the sheets update and print correctly except where the info is being put into textboxes or labels (they still retain the previous "i am awesome"). If you then hide the userform and go do each sheet manually (the ones with the textboxes & labels), the information is now correct.
I know this has something to do with the screen updating, i just can't figure out how to force the textboxes and labels to update BEFORE it is printed.
I've experimented with turning on screenupdating = true before the code to update the textboxes but that doesn't seem to work.
any help would be much appreciated.
An eg of the code i'm using is below
sheets(1).textbox1.value = userform1.projectinfo.value
sheets(1).label1.caption= userform1.projectnumber.value
the code below will update fine prior to printing
sheets(1).cells(1,1).value = userform1.projectinfo.value