LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default CSV Help needed

I have 1 workbook with multiple worksheets and I am creating CSVs for each
worksheet. The issue is before I load the CSVs in another application, I
need to delete any duplicates and empty rows from the CSVs. I am getting
duplicates and empty rows in my CSVs because the workbook contains formulas
to populate the data in the worksheets based on certain criteria. So, some
of the rows on certain worksheets make not be populated and some may be
duplicates. Is there a way to remove the empty rows and duplicate rows
either before or after the CSVs are created that is not manual. I am using
the following to create my CSVs:


Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim wCtr As Long
Dim w As Worksheet
Dim myNames As Variant

myNames = Array("SHEET1", "SHEET2", "SHEET3", "SHEET4", "4X LANE",
"SHEET5", "SHEET6", "SHEET7", "SHEET8") 'add more
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For wCtr = LBound(myNames) To UBound(myNames)
Set w = Worksheets(myNames(wCtr))
w.Copy
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path _
& "\" & w.Name, FileFormat:=xlCSV
ActiveWorkbook.Close
Next wCtr
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Rows With Non-Needed Data between Needed Data Daren Excel Worksheet Functions 2 September 30th 08 06:47 PM
sum(if...) help needed! Jarek Excel Discussion (Misc queries) 3 March 11th 08 07:48 PM
help needed Gary Excel Programming 4 December 6th 06 05:14 PM
Help needed please.. John Excel Discussion (Misc queries) 0 January 11th 06 04:07 PM
help needed BDCC Excel Programming 1 August 11th 03 03:24 PM


All times are GMT +1. The time now is 10:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"