Forgive my ignorance (newby and little knowledge of VBA)...
I have developed some macros that are attached to buttons, and working in one worksheet in a workbook. The macros perform various jobs on a calendar. There is one calendar for each of 10 bedrooms in the wing of a hospital.
I now want to make identical worksheets with the same buttons and macros for each bedroom i.e. 10 worksheets.
But try as I might I cant get the macros to work in the other worksheets.
The macros are in the VBA code editor for the first worksheet (Bed1). I have copied the code into the "This Workbook" page within the VBA editor - but that had no effect, other than to stop them working at all.
This is a typical macro:
'============================================
Private Sub Prevw1_Click()
'============================================
' DAILY PATIENT TIMETABLE
' PRINT PREVIEW
'============================================
ActiveSheet.Select
ActiveSheet.AutoFilterMode = False
Range("_Daily").Select
ActiveSheet.PageSetup.PrintArea = "_Daily"
'
Call page_SetUp
'
' Variations for page setup
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(1.5)
.RightMargin = Application.InchesToPoints(0.9)
.Zoom = 75
End With
ActiveSheet.PrintPreview
ActiveSheet.PageSetup.PrintArea = ""
Range("H126, H126").Select
End Sub
Q. What have I done wrong that makes this only work in the Bed1 worksheet where it was developed first?
Kind regards Russ