Home |
Search |
Today's Posts |
#3
![]() |
|||
|
|||
![]()
thanks a lot for your help, please can you advice me where I should insert it in my code?
Sub AAA() Dim FSO As Scripting.FileSystemObject Dim FF As Scripting.Folder Dim SubF As Scripting.Folder Set FSO = New Scripting.FileSystemObject Set FF = FSO.GetFolder("C:\Users\g.khanna\Desktop\Recons\Sp ain\") For Each SubF In FF.SubFolders DoOneFolder SubF Next SubF End Sub Sub DoOneFolder(FF As Scripting.Folder) Dim F As Scripting.file Dim SubF As Scripting.Folder Dim WB As Workbook Application.DisplayAlerts = False For Each F In FF.Files Set WB = Workbooks.Open(F.Path) ' select data from open workbook Sheets("Open items").Select ActiveSheet.Unprotect Password:="trunte" Range("A15000").Select ActiveCell.FormulaR1C1 = "NON" Range("A9:I9").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Windows("ADC Final.xlsm").Activate Range("A2").Select 'find the next empty row Do If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0).Select End If Loop Until IsEmpty(ActiveCell) = True Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False WB.Close SaveChanges:=False Debug.Print F.Name Next F For Each SubF In FF.SubFolders DoOneFolder SubF Next SubF End Sub
__________________
Regards Gaurav |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Updating data automatically using macro | Excel Programming | |||
CELL("filename",a1) not updating automatically | Excel Discussion (Misc queries) | |||
macro updating imported data and pivot tables | Excel Programming | |||
Updating original data from vlookup screen (macro?) | Excel Programming | |||
Macro to Open the Menu Data,Refresh Data,filename,import | Excel Programming |