I have a group of selected cells that I need to run the formula (x-TRUNC(x)) on in VBA. I then need to COUNTIF them for every "3:00 AM". But I need the change to happen exactly where the selected cells are. So below in the picture, I need those to be affected by the equation but still be in the same spot. What would be the best way to go about this? Can it be done while still having them all selected? Maybe an Array?
I have to use the equation on them because of the way they get imported from the software I have to use. So I need to turn it into a form that allows me to run COUNTIF on.
The ultimate goal is that I just need the COUNTIF number for 3:00 AM for each selected group.
I'm not sure this is correct at all, but looking for something in this direction:
Dim counted As Integer
Dim myArray As Variant
Range(ActiveCell, ActiveCell.End(xlDown)).Select
myArray = Selection
For Each Item In myArray
Item = Item - TRUNC(Item)
Next
counted = WorksheetFunction.CountIF(myArray, "3:00 AM")
Sheets("Report").Range("C" & x).Value = counted & " shifts"