

Sub pAdvanceFilter(rngdestRange As Range, Optional blnIsUnique As Boolean = True, Optional strSheetName As String = "Rawdata") Set rngTemp = rngFinalOutPut.Cells(1, lngLoop)Ĭall pAdvanceFilter(rngTemp, False, strSheetName) Set rngFinalOutPut = shtOutPut.Range("rngOutPut").CurrentRegionįor lngLoop = 1 To

StrArrayProduct(lngCtr, 0) = strTimeStamp ReDim Preserve strArrayProduct(0 To lngCtr, 0 To 1) StrProduct = strProduct & "," & varData(lngLoop2, 2) If strTimeStamp = varData(lngLoop2, 1) Then VarData = wksSheet.Range("a1").CurrentRegionįor lngLoop = LBound(varData, 1) + 1 To UBound(varData, 1)įor lngLoop2 = LBound(varData, 1) + 1 To UBound(varData, 1) Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy wksSheet.Range("A1") Range("A1").CurrentRegion.AutoFilter Field:=6, Criteria1:=strTerritory Range("A1").CurrentRegion.AutoFilter Field:=6 Range("A1").CurrentRegion.AutoFilter Field:=7 Range("A1").CurrentRegion.AutoFilter Field:=7, Criteria1:=strFLSM ' If strFLSM "National- Total Portugal" Then Range("A1").CurrentRegion.AutoFilter Field:=5, Criteria1:="FINAL" VarData = ThisWorkbook.Worksheets("Sheet1").Range("a1").CurrentRegion

Range("A" & Rows.Count).End(xlUp).Row + 1 Sub pPrintOutPut(strDescription As String, strPrice As String, strRating, strProduct As String, strBrand As String) Spos = InStr(1, strResponseText, "id=""pagnNextLink") If InStr(1, strResponseText, "id=""pagnNextLink") > 0 Then LngStart = InStr(lngStart, strResponseText, "currencyINR")Ĭall pPrintOutPut(strDescription, strPrice, strRating, strProduct, strBrand) StrDescription = WorksheetFunction.Substitute(strDescription, ">", "") StrDescription = Mid(strResponseText, lngStart, lngEnd - lngStart) LngEnd = InStr(lngStart, strResponseText, "") Spos = InStr(spos + 10, strResponseText, "h2 class=") StrLink = strUrl & midtext(strLink, 1, """", """")

LngEnd = InStr(lngStart, strResponseText, strBrand & "") LngStart = InStr(strResponseText, "Brands") StrLink = WorksheetFunction.Substitute(Mid(strResponseText, lngStart, lngEnd - lngStart), "amp ", "") LngEnd = InStr(strResponseText, strProduct & "") StrLink = strUrl & midtext(strLink, 1, "'", "'") StrLink = Mid(strResponseText, lngStart, lngEnd - lngStart) LngEnd = InStr(lngStart, strResponseText, "class") LngStart = InStrRev(strResponseText, "href=", lngEnd) LngEnd = InStr(strResponseText, "Category") With ThisWorkbook.Worksheets("Sheet2").Range("a1").CurrentRegion StrUrl = ThisWorkbook.Worksheets("Sheet1").Range("a1").Value This is how we can Export data from Excel to Access by using VBA in Microsoft Excel. Here the Macro is named as “ADOFromExcelToAccess”ġ6. The Shortcut Key to View Macros is ALT + F8ġ5. Once this is pasted, go to the Excel fileġ2. Fields("FieldNameN") = Range("C" & r).ValueĨ. Fields("FieldName2") = Range("B" & r).Value Fields("FieldName1") = Range("A" & r).Value ' repeat until first empty cell in column A Rs.Open "TableName", cn, adOpenKeyset, adLockOptimistic, adCmdTable "Data Source=C:\FolderName\DataBaseName.mdb " ' this procedure must be edited before useĭim cn As ADODB.Connection, rs As ADODB.Recordset, r As LongĬn.Open "Provider=.4.0 " & _ ' exports data from the active worksheet to a table in an Access database
HOW TO EXPORT EXCEL TO ACCESS CODE
In the Code Window, Copy and Paste the below mentioned Code Below is the VBA code and process which you need to paste in the code module of the file.ħ. We can export the data from Microsoft Excel to Microsoft Access by using VBA.
