Hi!
I have got some code that is working beautifully on PC but not when the file is used on Mac. I'm hoping there is a way to get the code to work on both PC and MAC as we have two people needing to use the file, one with PC and one with a MAC. Any suggestions hugely appreciated!
The code is so you can select one or more staff members, and then a date range so you can see the schedule for those selected staff for the selected date range. The code is:
Sorry if there is an obvious solution to this - I am very new to the world of VBA
The other code (to then unhide all columns so can see all staff for all dates) works fine on MAC:
Thanks for any thoughts on this
I have got some code that is working beautifully on PC but not when the file is used on Mac. I'm hoping there is a way to get the code to work on both PC and MAC as we have two people needing to use the file, one with PC and one with a MAC. Any suggestions hugely appreciated!
The code is so you can select one or more staff members, and then a date range so you can see the schedule for those selected staff for the selected date range. The code is:
Code:
Sub HideStaffDate()
Rows(2).Hidden = True
Rows(3).Hidden = False
Dim Ans As Variant
Dim Dstart As String, Dend As String
Dim Cnt As Long
Ans = InputBox("Please enter staff member/s (separating names with commas)")
If Ans = "" Then Exit Sub
Dstart = InputBox("Enter a start date")
If Dstart = "" Then Exit Sub
Dend = InputBox("Enter an end date")
If Dend = "" Then Exit Sub
Sheets("Staff").UsedRange.Offset(, 1).EntireColumn.Hidden = False
For Cnt = 3 To Cells(3, Columns.Count).End(xlToLeft).Column
If (Cells(3, Cnt) < CDate(Dstart) Or Cells(3, Cnt) > CDate(Dend)) Or InStr(1, Ans, Cells(4, Cnt), vbTextCompare) = 0 Then
Columns(Cnt).Hidden = True
End If
Next Cnt
End Sub
Sorry if there is an obvious solution to this - I am very new to the world of VBA
The other code (to then unhide all columns so can see all staff for all dates) works fine on MAC:
Code:
Sub UnhideAll()
Rows(2).Hidden = False
Rows(3).Hidden = True
Columns.EntireColumn.Hidden = False
End Sub
Thanks for any thoughts on this