Option Compare Database
Sub test()
Dim newapp As Excel.Application
Dim newworkbook As Excel.Workbook
Dim rst As DAO.Recordset
Dim newtab As String
Dim sqlstatement As String
Dim rng As Excel.Range
Set newapp = New Excel.Application
newapp.Visible = True
Set newworkbook = newapp.Workbooks.Add
Set rst = CurrentDb.OpenRecordset("Step1")
Do Until rst.EOF
newtab = rst("Policy")
Sheets.Add.Name = newtab
rst.MoveNext
Loop
Sheets("sheet1").Delete
Sheets("sheet2").Delete
Sheets("sheet3").Delete
For Each Sheet In ActiveWorkbook.Sheets
sqlstring = "SELECT claim FROM sampletable WHERE policy = " & Sheet.Name
Set rst = CurrentDb.OpenRecordset(sqlstring, dbOpenSnapshot)
Sheet.Range("A1").CopyFromRecordset rst
Next Sheet
End Sub