Hey all,
I work at a hospital and we have a daily workload spreadsheet that each team in the department completes daily to allocate staff. We then store the data by pressing submit which uses the code below that I worked up.
My issue is that this all depends on the wards remaining on the row number as they were first placed on and I’m not sure I can guarantee that as we have 7 teams with a lot of people who may tinker.
FYI each team has a separate version of the sheet and filters out wards they don’t need to see.
Thanks.
I work at a hospital and we have a daily workload spreadsheet that each team in the department completes daily to allocate staff. We then store the data by pressing submit which uses the code below that I worked up.
My issue is that this all depends on the wards remaining on the row number as they were first placed on and I’m not sure I can guarantee that as we have 7 teams with a lot of people who may tinker.
FYI each team has a separate version of the sheet and filters out wards they don’t need to see.
Thanks.
VBA Code:
Sub data_input()
Dim String1 As String
String1 = "CDU"
Dim String2 As String
String2 = "DCU"
Dim String3 As String
String3 = "ED"
Dim String4 As String
String4 = "ITU"
'etc for each ward
'Input CDU data
Sheet1.Select
Range("C11:J11").Select
Selection.Copy
Cells(1, 1).Select
Sheets([String1]).Visible = True
Sheets([String1]).Select
Range("B" & Rows.Count).End(xlUp).Offset(1).Select
ActiveSheet.Paste
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
Selection.Value = Date
Cells.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Cells(1, 1).Select
Sheets([String1]).Visible = False
End Sub