I have a range of data emp number, last name, first name, total minutes, coach and date, there is up to 100 rows as we pull this information daily.
I need to be able to compare the date to today's date then copy the first and last name of each employee when the date column equals today's date on a worksheet named for each month in today's date cell (this is formatted as a calendar).
I have always had issues with any loops, I could do a nested if statement however that's messy and long and should be a lot easier. so maybe a do while to step through each cell in the date column, maybe I'm asking the wrong question, this could also be why I cannot find the solution.
This is what I have so far, I know its not a loop but its a start
I need to be able to compare the date to today's date then copy the first and last name of each employee when the date column equals today's date on a worksheet named for each month in today's date cell (this is formatted as a calendar).
I have always had issues with any loops, I could do a nested if statement however that's messy and long and should be a lot easier. so maybe a do while to step through each cell in the date column, maybe I'm asking the wrong question, this could also be why I cannot find the solution.
This is what I have so far, I know its not a loop but its a start
Code:
Sub emp_days()
'This macro updates the calandar with the information required by matching dates.
'turns off updating
Application.ScreenUpdating = False
'Set variable to cell/s to reference for data require
Dim Today As String
Today = Sheets("sheet1").Range("O2").Value
If Sheets("Sheet1").Range("$F$5").Value = Today Then
Sheets("Sheet1").Activate
Range("C5:B5").Select
Selection.Copy
Range("G2").Select
Selection.PasteSpecial
End If
End Sub
Last edited: