New to VBS and VBA

B

Barak

Sorry if this seems like a stupid question.

Here is what I would like to be able to do.

1. Save a worksheet within a workbook as a CSV file
There are lots of references (formulas and functions) within the
worksheet to other worksheets and I need the data only out so I can do a
final manipulation.
2. Open the CSV file and delete columns E - G
3. Delete row if column D = 0
4. Resave the file.

Is this all possible? If so, could you please guide me in the correct
direction. Thanks
 
T

Tom Ogilvy

Activesheet.Copy
ActiveSheet.UsedRange.Formula = Activesheet.UsedRange.Value
activeSheet.Range("E:G").Delete

for i = cells(rows.count,4).End(xlup).row to 1 step -1
if cells(i,4).Value = 0 then
cells(i,4).Entirerow.Delete
end if
Next
ActiveWorkbook.SaveAs "C:\My Files\Mybook.csv", FileFormat:=xlCSV
 
Top