Hello. I may be completely off base with this but I am using the following code in Access and need help. How can I modify the following to check if the count of "i" is divisible by 10...if it is then save the Excel workbook I have open and if it isn't divisible by 10 then do nothing? So, basically, I am looking to see if the total count of worksheets divided by 10 is a whole number. If so, then save the workbook and continue through the loop.
Code:
xlApp.DisplayAlerts = False
With xlWb
Dim i As Integer
i = .Sheets.Count
If isinteger(i / 10) Then
ActiveWorkbook.Save
Else 'continue
End If
For y = 1 To i
xlWb.Sheets(y).Select
With ActiveSheet
If Left(xlWb.Sheets(y).NAME, 5) = "Sheet" Then
xlWb.Sheets(y).Delete
GoTo recount
End If
End With
Next y
End With
xlApp.DisplayAlerts = True