How ro Show a Userform *After* vba has run on sheet?

AyurvedaPura

New Member
Joined
Jan 4, 2012
Messages
44
Hi

I want my userform to launch on workbook open...I have it set to do so...

One of it's textboxes is filled from a cell on Sheet 'Enrol Schedule' that references a UDF Function.

On being chellenged to enable macros, once confirming the userform shows immediately.

This Function results in a #NAME error until the userform is closed, then re-launched. As soon as the form is closed, the Function vba is recognised and the cells referencing it fill with a special string I need in my textbox, 'TimeElapsed'.

How do I ensure the vba enabling allows all the cells on the sheet 'Enrol Schedule' to fill correctly from the function 'YearsMonthsDays' (in its own Module) first, and then launches the Userform, so the textbox who's source is the cell on the worksheet referencing the Function is filled, rather than generating a Type Mismatch Error?

I read something about this earlier, but now can't find it...

Thanks

AP
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
In case not clear, the idea is to have it run from Workbook_Open event...allow the vba to populate worksheet cells, then show userform (populated with these UDF assisted values...)

Hope that's clear!

AP
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top