Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2007

Tip: Looking for answers? Try searching our database.

VBA to delete a row based on rows being filled.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jlclyde - 27 Nov 2007 13:32 GMT
Here is my code.  I move information from one sheet to another.  This
part works fine.  I then woudl like to delete rows if there is nothing
in columns J, M, S, and V.  Someone had given me the code to go
through the sheet.  Hopefully someone can help me.

Jay

Sub Offset()
Dim myCount As Integer
Dim NextRow As Long
Dim Datei As Date

Datei = Range("E1")

Range("A7:C26, V7:Am26, Bm7:Bp26").Copy
Application.ScreenUpdating = False
Workbooks.Open Filename:="G:\DPE-IPE\DPE REVISIONS\All Press Ips.xls"
NextRow = Range("D65536").End(xlUp).Row + 1

Sheets("Offset").Range("D" & NextRow).PasteSpecial
Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False

Dim i As Long
With Sheets("Offset")
   ' Loop through the rows
  For i = 1 To .Cells.SpecialCells(xlCellTypeLastCell).Row
   ' Test cells in columns J, M, S &V
       If .Cells(i, 10).Value = "0" And .Cells(i, 13).Value = "0"
And .Cells(i, 19).Value = "0" _
           And .Cells(i, 22).Value = "0" Then .Cells(i,
1).EntireRow.Delete
   Next i
End With

End Sub
Helmut Weber - 27 Nov 2007 14:19 GMT
Hi,

that is Excel-code.

Try ...public.excel.programming

Signature

Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000 (german versions)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.