ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   New to VBS and VBA (https://www.excelbanter.com/excel-programming/302550-new-vbs-vba.html)

Barak[_2_]

New to VBS and VBA
 
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



Tom Ogilvy

New to VBS and VBA
 
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

--
Regards,
Tom Ogilvy

"Barak" wrote in message
...
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






All times are GMT +1. The time now is 05:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com