#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Rows


Managed to get it to do what i want now all i did was add a few of line
that ive put in Bold to the original code i had working before


Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
FOR I = 1 TO 4
WORKSHEETS(I).ACTIVAT
LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "D").Value = blank Then
Rows(RowNdx).Delete
End If
Next RowNdx
NEX
Sheets("Sheet2").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\evt_test.csv", FileFormat:= _
xlCSV, CreateBackup:=False
Sheets("Sheet3").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\mkt_test.csv", FileFormat:= _
xlCSV, CreateBackup:=False
Sheets("Sheet4").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\SEL_TEST.csv", FileFormat:= _
xlCSV, CreateBackup:=False

End Sub


Thanks for the hel

--
scottymellot
-----------------------------------------------------------------------
scottymelloty's Profile: http://www.excelforum.com/member.php...nfo&userid=380
View this thread: http://www.excelforum.com/showthread.php?threadid=27150

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete Rows

If you want to respond to prompts everytime you run it after the first time,
you like repetitious code, and you don't mind renaming the current workbook
to a CSV file (and losing any changes not saved before running the macro),
then I guess you have a solution.

all i did was add a few of lines


Which 3 people took time to provided you with.

--
Regards,
Tom Ogilvy

"scottymelloty" wrote in
message ...

Managed to get it to do what i want now all i did was add a few of lines
that ive put in Bold to the original code i had working before


Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
FOR I = 1 TO 4
WORKSHEETS(I).ACTIVATE
LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "D").Value = blank Then
Rows(RowNdx).Delete
End If
Next RowNdx
NEXT
Sheets("Sheet2").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\evt_test.csv", FileFormat:= _
xlCSV, CreateBackup:=False
Sheets("Sheet3").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\mkt_test.csv", FileFormat:= _
xlCSV, CreateBackup:=False
Sheets("Sheet4").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\SEL_TEST.csv", FileFormat:= _
xlCSV, CreateBackup:=False

End Sub


Thanks for the help


--
scottymelloty
------------------------------------------------------------------------
scottymelloty's Profile:

http://www.excelforum.com/member.php...fo&userid=3808
View this thread: http://www.excelforum.com/showthread...hreadid=271501



Reply
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
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 02:41 PM.

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

About Us

"It's about Microsoft Excel"