Thank you for the code. Altough it was useful but it did not work for me. I
can send a simplified file that explain the situation. I am not sure, if I
can attach a file here. Let me explain litle more in detail.
Sheet1 : I have two bottons for a macro.
Sub Killfile()
Dim MyFile As String
On Error Resume Next 'On hitting errors, code resumes next code
MyFile = "C:\teama\data\teamA.txt"
Kill MyFile
On Error Resume Next 'On hitting errors, code resumes next code
MyFile = "C:\teamb\data\teamB.txt"
Kill MyFile
End Sub
Sub SaveAsText()
' Save Open files as csv in MS-DOS format
Sheets("teamA").Select
ChDir "C:\teama\data"
ActiveWorkbook.SaveAs Filename:= _
"C:\teama\data\teamA.txt", FileFormat _
:=xlCSV, CreateBackup:=False
' Save Open files as csv in MS-DOS format
Sheets("teamB").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\teama\data\teamB.txt", FileFormat _
:=xlCSV, CreateBackup:=False
End Sub
in "data" worksheet, I have following fields and data
product Rq date Sale Person Sale Date Price Sales ID Commission Data2 Data3
-
In C-teamA and C-teamB, certain criteria are selected and filetered data
from "data worksheet"
In teamA worksheet
I have following simple link from C-teamA
In cell A1 to I1400
=IF('C-TeamA'!B2<>"",'C-TeamA'!B2,"")
So I want to save teamA, teamB...etc into csv text file. If any help, it
will greatly appricated.