finnstone
asked on
INSERT value into first row in 75 workbooks
i need to put this value "PERSONURL" WITHOUT THE QUOTES, into line 1 of 75 folders in a windows folder - all the files are csv
ASKER
just cell A1
Will that replace the value that is in "A1" currently, or insert a row or column?
»bp
»bp
It would also be useful if you could provide a sample of the data files for testing...
»bp
»bp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thx
Try this
Option Explicit
Public Sub UpdateCSV()
Dim fso, sFolder, sFil
On Error GoTo exit_proc
Application.ScreenUpdating = False
Set fso = CreateObject("Scripting.FileSystemObject")
''///Change this folder to the one you use.
Set sFolder = fso.getFolder("C:\Users\Roy Cox\Documents\csvfiles")
For Each sFil In sFolder.Files
If (sFil.Name Like "*.csv") Then
Workbooks.OpenText Filename:=sFil, _
DataType:=xlDelimited, Comma:=True, Local:=True
Range("A1").Value = "X"
sFil.Close True
End If
Next sFil
exit_proc:
Application.ScreenUpdating = True
End Sub
ASKER
got a similar 3rd case here
https://www.experts-exchange.com/questions/29021798/find-and-replace-in-column-A-across-75-csv-books.html
https://www.experts-exchange.com/questions/29021798/find-and-replace-in-column-A-across-75-csv-books.html
Will this be in just First Column & First Row or all the columns in First Row?