I'm using the below code
Sub WMC()
Dim wb As Workbook
Set wb = Workbooks.Open(Filename:="G:\filedirectory.xls")
With wb
For i = 1 To Sheets.Count
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 4), TrailingMinusNumbers:=True
Next i
End With
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
For some reason the loop runs but doesn't move from one sheet to the next - I think it just runs the same code on the first sheet in the workbook about ten times (as I have 10 sheets). If I remove the loop it runs once and closes so the code recognizes the loop, it just doesn't follow it. I've tried variations on the above but I get the same issue each time.
Any thoughts would be much appreciated.
Danke
Rachel