View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Deleting rows from list of files

Italia,

Try:

For j = 200 To 1 Step -1
If WorksheetFunction.CountA(newwb.Worksheets("Sheet1" ) _
.Range("A1:G200").Rows(j)) = 0 Then
newwb.Worksheets("Sheet1").Range("A1:G200") _
.Rows(j).EntireRow.Delete
End If
Next j


HTH,
Bernie
MS Excel MVP

"italia" wrote in message
oups.com...
I really appreciate your help.

I changed the Selection to Range ("A1:G200"). It is deleting rows from
the current file (worksheet where the macro exists) and not from any
other files.
We need to specify the particular file ("newwb") that we are opening. I
just done know how.

Thanks,
Italia