Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need to make use of the Microsoft Scripting runtime.
First create a reference to it in the Excel vbs ide (Tools references and select Microsoft scripting runtime). Then create a procedure such as: Sub GetFileNames(strFolder) Dim fso As New FileSystemObject Dim dir As Folder Dim fil As File Dim wb As Workbook Set dir = fso.GetFolder(strFolder) For Each fil In dir.Files Set wb = Workbooks.Open(fil.Path) With wb .Sheets(1).Range("D2").Value = "Goodbye" .Close (True) End With Next fil Set fso = Nothing Set dir = Nothing Set fil = Nothing End Sub ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Serach for multiple words in one cell | Excel Discussion (Misc queries) | |||
serach of dat | Excel Discussion (Misc queries) | |||
Macro Involving Find & Replace In Two Different Files | Excel Discussion (Misc queries) | |||
How to find/replace all of the names of files in EXCEL workbook. | Excel Discussion (Misc queries) | |||
Copy over files/replace (complete question) | New Users to Excel |