March 13, 2011 at 4:14 AM #1 I need help on a code that will run if the workbooks filename don't match. Code Private Sub CommandButton1_Click() If ActiveWorkbook("filename.xlsm") = False Then UserForm1.Show End Sub Thanks in advance
March 13, 2011 at 10:12 AM #2 Re: If workbook has different filename then run macro Code If ActiveWorkbook.name <> "filename.xlsm" then... ... although the name may or may not contain the extension. Check
March 13, 2011 at 10:15 AM #3 Re: If workbook has different filename then run macroHi migs_619,something like Code If ActiveWorkbook.Name Like ThisWorkbook.Name Then