i need the macro to run when i open a specific excel file.
Private Sub Workbook_AutoOpen ()
UserForm1.Show
End Sub
Does not work
what am i doing wrong?
Assuming you are concatenating cells A1 & B1, try this:
=SUBSTITUTE(A1,"'","_")&SUBSTITUTE(B1,"'","_")
Of course, you'll have to change "_" to whatever you want to replace ' with.
Regards,
BarrieBarrie Davidson
Notice how the apostrophe is handled when
concatenating cell A1 on a worksheet named
Sheet2's...
="cat "&'Sheet2''s'!A1
A double apostrophe replaces the single apostrophe
and the entire sheet name is enclosed by single
apostrophes. Make sure your macro emulates this
behavior.