Call from one file a UserForm in another
Write VBA code that calls a UserForm of one Excel file to all the other Excel files present in a folder called john and the master Excel (consists of the following code and the user form) is present in a different location: Private Sub Workbook_OnClick() Dim mypath As String Dim file As String Dim wb As Workbook Dim pat As String Application.ScreenUpdating = False ChDrive "C:" ChDir "C:\Users\Administrator\Desktop\John" 'john is a folder that consists of the excel files mypath = Range("B1").Value 'mypath has the same value as chDir file = Dir(mypath & "\" & "*.xlsx") Do While file <> "" Set wb