Currently i working with an excel reporting task, after copy paste data from sheet "source" to sheet "destination", i need to save only "destination" as txt file.
The code that i currently using is good, but the results not always consistent as sometime it will save the "source" into txt file instead of the "destination" file
this is the code that i am using :
I tried to add "Sheets("destination")in front of "range("A1").select , but it always hit error 1004 : select method of range class failed
The code that i currently using is good, but the results not always consistent as sometime it will save the "source" into txt file instead of the "destination" file
this is the code that i am using :
VBA Code:
Sub savefile()
Range("A1").Select
ChDir sheets("Main").Cells(3,2).value
ActiveWorkbook.SavesAs filename:= _
Sheets("Main").Cells(3,2).value+"799EBS.txt",fileformat:=xltext, _
create backup=false
end sub
I tried to add "Sheets("destination")in front of "range("A1").select , but it always hit error 1004 : select method of range class failed