In the absence of a workbook and the other formulae, best guess:
Option Explicit
Sub Test()
Sheets("Sheet1").Range("A2").Formula2 = _
"=LET(d,FILTER('Policy List'!A4:A5000,'Policy List'!A4:A5000<>""""),r,ROUNDUP(ROWS(d)*50%,0),TAKE(SORTBY(d,RANDARRAY(ROWS(d))),r))"
End Sub
Sub AuditSelection_TMS()
'
' AuditSelection Macro
'
Dim shNew As Worksheet
' delete the Adjusted List sheet, if it exists
On Error Resume Next
Application.DisplayAlerts = False
Sheets("Adjusted List").Delete
Application.DisplayAlerts = False
On Error GoTo 0
' create the Adjusted List sheet
Sheets("Policy List").Copy Before:=Sheets(2)
Set shNew = ActiveSheet
With shNew
.Name = "Adjusted List"
.Range("A4:A" & .Range("A" & .Rows.Count).End(xlUp).Row).ClearContents
.Range("C4:C" & .Range("C" & .Rows.Count).End(xlUp).Row).ClearContents
.Range("F4:F" & .Range("F" & .Rows.Count).End(xlUp).Row).ClearContents
.Range("A4").Formula2 = _
"=LET(d,FILTER('Policy List'!A4:A5000,'Policy List'!A4:A5000<>"""",""no data""),r,ROUNDUP(ROWS(d)*50%,0),TAKE(SORTBY(d,RANDARRAY(ROWS(d))),r))"
.Range("C4").Formula2 = _
"=LET(d,FILTER('Policy List'!C4:C5000,'Policy List'!C4:C5000<>"""",""no data""),r,ROUNDUP(ROWS(d)*50%,0),TAKE(SORTBY(d,RANDARRAY(ROWS(d))),r))"
.Range("F4").Formula2 = _
"=LET(d,FILTER('Policy List'!F4:F5000,'Policy List'!F4:F5000<>"""",""no data""),r,ROUNDUP(ROWS(d)*50%,0),TAKE(SORTBY(d,RANDARRAY(ROWS(d))),r))"
' convert to values
With .Range("A4:G" & .Range("A" & .Rows.Count).End(xlUp).Row)
.Value = .Value
End With '.Range()
End With 'shNew
End Sub
Bookmarks