OregonUnknown
New Member
- Joined
- May 28, 2019
- Messages
- 1
I am NOT the greatest in Excel or VBA. In fact until the last week, I never used VBA, but am learning a lot from Forums and instructional videos. I appreciate everyone of you who participate in these forums and help out those of us who, at times, are utterly and completely lost!
I need to select random employees for drug and alcohol testing.
I created a sheet that allows me to input employee names, employee numbers, and their position into an "employee listing" and then assign a random number to that individual. I then added a button that will "refresh and reassign" the random numbers assigned to each participant and select, at random, "x" amount of people for Drug and/or Alcohol testing which is dependent on the current or active quarter. Then a report is generated that reflects when the selections were made, who was selected and for what testing level.
My issue is that I need to record each change on a separate log in the same work book then compile each log into one.
So I need the log to record additions/deletions/changes between G4:I999 (Employee information) ---This I already have completed as it follows the "active cell"
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
and the random selections for Alcohol testing M15:O19 (Alcohol Testing selections and Employee info).
Both lists are populated when the "refresh" button is hit.
Any help on how to record changes after refresh?
I need to select random employees for drug and alcohol testing.
I created a sheet that allows me to input employee names, employee numbers, and their position into an "employee listing" and then assign a random number to that individual. I then added a button that will "refresh and reassign" the random numbers assigned to each participant and select, at random, "x" amount of people for Drug and/or Alcohol testing which is dependent on the current or active quarter. Then a report is generated that reflects when the selections were made, who was selected and for what testing level.
My issue is that I need to record each change on a separate log in the same work book then compile each log into one.
So I need the log to record additions/deletions/changes between G4:I999 (Employee information) ---This I already have completed as it follows the "active cell"
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("D5:I99999")) Is Nothing Then
Range("B3").Value = Target.Row
If Range("F" & Target.Row).Value = "Cell Change" Then Log_PlaceUndoButton Else: Shapes("UndoBtn").Visible = msoFalse
Else:
Shapes("UndoBtn").Visible = msoFalse
End If
End Sub
My problem is that I then need to record the random Selections for drug testing in M04:O08 (Drug Testing Selections and Employee info)
and the random selections for Alcohol testing M15:O19 (Alcohol Testing selections and Employee info).
Both lists are populated when the "refresh" button is hit.
Any help on how to record changes after refresh?