You would give the HideThings an argument that specifies which workbook to operate on:
Your calling routine then calls the HideThings routine with wb as its argument:Sub HideThings(wb2WorkOn As Workbook) With wb2WorkOn .Sheets("Fusionspapier").Visible = False .Sheets("Data").Visible = False .Sheets("Name").Columns("L:L").EntireColumn.Hidden = True .Sheets("Name").Columns("N:N").EntireColumn.Hidden = True End With End Sub
'Some code which sets wb to a workbook HideThings wb