![]()
Case "Insight" With ActiveWorkbook.Sheets .Add after:=Worksheets(Worksheets.count) End With ActiveSheet.Name = "Insight_records" Sheets("AGE_INSIGHT").Rows(1).Copy ActiveSheet.Rows(1).PasteSpecial xlPasteAll ActiveSheet.Rows(1).PasteSpecial xlPasteColumnWidths insightFlag = True For i = 0 To UBound(myArray) strSQL = "select * from [AGE_INSIGHT$] where [Scenario ID]= '" & myArray(i) & "' " closeRS OpenDB rs.Open strSQL, cnn, adOpenKeyset, adLockOptimistic old_count = rs.RecordCount 'If i = 0 Then 'Range("A1:A" & rs.RecordCount & " ").Select 'Else 'Range("A" & old_count & ":A" & rs.RecordCount & " ").Select 'End If Sheets("Insight_records").Range("A" & Rows.count).End(xlUp).Offset(1).CopyFromRecordset rs Next
Bookmarks