Andy,Leith
Apologies for not posting a reply earlier.
I came in this morning with a clear head and figured out that I had not selected the sheet for the code to run on. The reason it ran on the dataform closure is that the sheet was already activated.
I solved this a little differently, in that with the OK button I now have this:-
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
If Sheet1.Visible = True Then Sheet1.Visible = False
Call Update_All 'this calls the update_all macro that updates all the figures on all tasks worksheet
Unload UserForm3
Application.ScreenUpdating = True
End Sub
The reason to make the sheet hidden is because however I configure the screen updating, if I select another option button with sheet1 visible the screeen jumps to sheet1 and then back again. Might not be perfect but it works.
and for the All Update code I have this:-
Sub Update_All() 'this code just call all the above code for either the manual input on the Information page, or the OK
'button on the Select Nation userform.
Sheet1.Activate
With ActiveSheet
Call FHtoCal
Call FCtoCal
Call EHtoCal
Call APUCYtoCal
Call APUHrstoCal
End With
End Sub
It has the same result though.
Many thanks again.
JD
Bookmarks