Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to create a procedure that will loop through all files in a specified
path, insert a new column in each file called FileName, then write the actual file name for that file into the column all the way down the list. How can I accomplish this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub addcolumns() Const MyPath = "c:\temp" First = True Do If First = True Then Filename = Dir(MyPath & "\*.xls") First = False Else Filename = Dir() End If If Filename < "" Then Workbooks.Open (MyPath & "\" & Filename) Range("B1").EntireColumn.Insert Range("B1:B100").Value = Filename End If Workbooks(Filename).Close Loop While Filename < "" End Sub "Kirk P." wrote: I need to create a procedure that will loop through all files in a specified path, insert a new column in each file called FileName, then write the actual file name for that file into the column all the way down the list. How can I accomplish this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I can't insert column in Excell file! Help please | Excel Worksheet Functions | |||
insert a blank column between each column in a data file | Excel Discussion (Misc queries) | |||
insert row / insert column command buttons | Excel Worksheet Functions | |||
Mass add in a column | Excel Discussion (Misc queries) | |||
I want to do mass mailing in outlook, from an excel file that has. | Excel Discussion (Misc queries) |