I would like to Access a folder that has 400 excel workbooks. Loop through the folder and accessing a specific sheet. After that I want to Copy selected Cells based on some criteria and then send all theses rows to MS Access.. (All 400 Workbooks are identical in the design, and the sheets name are the same in all workbooks) could this be done?? And if so. Could anyone please tell me where to start?
I have already wrote the excel VBA code for selecting the cells.
Thanks
This is the start of my code
Sub Copy2()
Dim RngDestination As Range
Dim i As Integer
Set RngDestination = Worksheets("Sheet2".Range("A1"
For i = Cells(Rows.Count, "M".End(xlUp).Row To 1 Step -1
If Cells(i, "M".Interior.ColorIndex = -4142 Then
Cells((i, "B",(i,"C"Cells(i,"M").Copy Destination:=RngDestination
Set RngDestination = RngDestination.Offset(RngDestination.Rows.Count)
End If
Next I
But the Rngdestination should not be sheet2,, it should be the access table
Thanks for the tip
I have already wrote the excel VBA code for selecting the cells.
Thanks
This is the start of my code
Sub Copy2()
Dim RngDestination As Range
Dim i As Integer
Set RngDestination = Worksheets("Sheet2".Range("A1"
For i = Cells(Rows.Count, "M".End(xlUp).Row To 1 Step -1
If Cells(i, "M".Interior.ColorIndex = -4142 Then
Cells((i, "B",(i,"C"Cells(i,"M").Copy Destination:=RngDestination
Set RngDestination = RngDestination.Offset(RngDestination.Rows.Count)
End If
Next I
But the Rngdestination should not be sheet2,, it should be the access table
Thanks for the tip