I have a huge numbers of CSV file inside a folder, each file is with single sheet. I want to insert a column in all files before the “A” column with a column header. In that new column I want to copy the sheet name to all the cells till empty rows. I am success full with adding column along with column heading with following script, now I nee help to copy sheet names to the cells. ''' Sub LoopThroughFolder()
Dim MyFile As String, Str As String, MyDir As String, Wb As Workbook
Dim Rws As Long, Rng As Range
Set Wb = ThisWorkbook
MyDir = "C:\Users\Sanghita\Desktop\test\"
MyFile = Dir(MyDir & "*.CSV")
ChDir MyDir
Application.ScreenUpdating = 0
Application.DisplayAlerts = 0
Do While MyFile <> ""
Workbooks.Open (MyFile)
Range("A1").EntireColumn.Insert
Range("A1").Value = "Police force" 'New Column Name
ActiveWorkbook.Save
ActiveWorkbook.Close True
MyFile = Dir()
Loop
End Sub
''''