Hey,
can someone tell me how I make buttons show in all sheets and in all newly created sheets?
I have about 10 sheets wit the same commandbuttons with these same codes asigned to them by copying these codes for every sheet.
Private Sub CommandButton1_Click()
On Error GoTo err_handler
ActiveWorkbook.FollowHyperlink Address:="\\private\workbook.XLS", SubAddress:=" 'sheet1'!a1", _
NewWindow:=True
Exit Sub
err_handler:
End Sub
Private Sub CommandButton2_Click()
On Error GoTo err_handler
ActiveWorkbook.FollowHyperlink Address:="\\private\workbook.XLS", SubAddress:=" 'Sheet2'!a1", _
NewWindow:=True
Exit Sub
err_handler:
End Sub
Private Sub CommandButton3_Click()
On Error GoTo err_handler
ActiveWorkbook.FollowHyperlink Address:="\\private\workbook.XLS", SubAddress:=" 'Sheet3'!a1", _
NewWindow:=True
Exit Sub
err_handler:
End Sub
Private Sub CommandButton4_Click()
On Error GoTo err_handler
ActiveWorkbook.FollowHyperlink Address:="\\private\workbook.XLS", SubAddress:=" 'Sheet4'!a1", _
NewWindow:=True
Exit Sub
err_handler:
End Sub
Private Sub CommandButton5_Click()
On Error GoTo err_handler
ActiveWorkbook.FollowHyperlink Address:="\\private\workbook.XLS", SubAddress:=" 'sheet5'!a1", _
NewWindow:=True
Exit Sub
err_handler:
End Sub
Private Sub CommandButton6_Click()
On Error GoTo err_handler
ActiveWorkbook.FollowHyperlink Address:="\\private\workbook.XLS", SubAddress:=" 'sheet6'!a1", _
NewWindow:=True
Exit Sub
err_handler:
End Sub
Can I not put these codes in the "This workbook" and only make these commandbuttons on sheet1. So all the other sheets display these buttons to and also work with the codes?
Bookmarks