Hi All,
I am using below macro code where a dialouge box is opening to select multiple excel files.
Next step i am looking for is macro to repeat the highlighted code {Starts from column("E:E")} activity for all the files I have selected. can you guys help me with same. May be a loop is needed here but I am not that good with VBA yet. Appreciate your help on this.
I am using below macro code where a dialouge box is opening to select multiple excel files.
Next step i am looking for is macro to repeat the highlighted code {Starts from column("E:E")} activity for all the files I have selected. can you guys help me with same. May be a loop is needed here but I am not that good with VBA yet. Appreciate your help on this.
VBA Code:
sub billingstatus ()
Dim i as Integer
'opening file dialog box
With application. FileDialog(msofiledialogfilepicker)
' enabling multiple files select
. Allowmultiselect= True
. Filters. Clear
'only excel files can be selected
. FiltersAdd "excel files", "*. Xslx*"
If. Show = True then
For i = 1 to. Selecteditems(i) . Count
' opening file
Workbooks. Open. SelectedItems(i)
Next i
End if
End With
[B]Columns ("E:E"). Select
Selection.numberformat = "0"
Activeworkbook.pivotcaches.create(sourcetype:=xldatabase, sourcedata:=
"Sheet1! R1C1:R 32676",version :=6). Createpivottable tabledestination:="_,
Tablename:=" pivottable3", defaultversion:=6
With Activesheet. Pivottables("pivottable3")
Ingriddropzones = True
End with
Activeworkbook. Close[/B]
End sub