Hiya,
Thank you, in advance, for your help.
I currently have a macro that identifies unique data, based on cells "B"-"D". As the macro loops, it pastes the unique count number into Column "AL". At the end of the section, a MsgBox appears with the total unique # and 25% of that #. ( This then loops, until it finds the next blank cell, which produces another MsgBox...so on and so forth.)
I want this MsgBox information to be pasted into the correlating "AM" (total unique #) & "AN" (%) cells.
Thank you, in advance, for your help.
I currently have a macro that identifies unique data, based on cells "B"-"D". As the macro loops, it pastes the unique count number into Column "AL". At the end of the section, a MsgBox appears with the total unique # and 25% of that #. ( This then loops, until it finds the next blank cell, which produces another MsgBox...so on and so forth.)
I want this MsgBox information to be pasted into the correlating "AM" (total unique #) & "AN" (%) cells.
Code:
Sub NumberToAudit()
Range(ActiveCell, ActiveCell.Offset(1, 0)).Select
ActiveCell.Offset(1, 0).Range("A1").Select
CurrentNumber = 1
ActiveCell.Offset(0, 36).Value = CurrentNumber
Do Until ActiveCell.Value = Empty
CurrentFN = ActiveCell.Value
CurrentLN = ActiveCell.Offset(0, 1).Range("A1").Value
CurrentDOB = ActiveCell.Offset(0, 2).Range("A1").Value
CurrentRow = ActiveCell.Row
Do Until Not (ActiveCell.Offset(1, 0).Range("A1").Value = CurrentFN And ActiveCell.Offset(1, 1).Range("A1").Value = CurrentLN And ActiveCell.Offset(1, 2).Range("A1").Value = CurrentDOB)
ActiveCell.Offset(1, 0).Select
ActiveCell.Offset(0, 36).Value = CurrentNumber
Loop
ActiveCell.Offset(1, 0).Range("A1").Select
If Not (ActiveCell.Value = Empty) Then
CurrentNumber = CurrentNumber + 1
ActiveCell.Offset(0, 36).Value = CurrentNumber
End If
Loop
MsgBox "Total number = " & CurrentNumber
TwentyfivePercent = 0.25 * CurrentNumber
MsgBox "To audit " & TwentyfivePercent