I am importing data from Microsoft Access, the error detection doesn't seem to be working. If the code tries to create a sheet that already exists, keep going and set the destinationsheet to the already present sheet. Any tips wold be appreciated.
For ix = stWW To edWW
For modi = 0 To mdcnt - 1
On Error Resume Next
Sheets.Add(After:=Sheets(Sheets.Count)).Name = ix & " " & modvar(modi)
On Error GoTo 0
Set DestinationSheet = Worksheets(ix & " " & modvar(modi))
'strSQL2 = "SELECT 1302_Scan.* FROM 1302_Scan;"
strSQL = "SELECT " & ix & "_" & modvar(modi) & ".* FROM " & ix & "_" & modvar(modi) & ";"
'MsgBox strSQL & "|" & strSQL
DestinationSheet.Cells.Clear
used earlier in code, may be causing error to @sous2817's suggestion.
On Error GoTo continue
Do While Not IsNull(modvar(ii))
mdcnt = mdcnt + 1
ii = ii + 1
Loop
continue:
On Error GoTo 0