Vba to write...on VeryHidden sheet.

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi, 'm using this code to delete rows in very hidden sheet...does not work...please assist...

no error though

Thanks.

Code:
[/FONT]
[FONT=Courier New][/FONT] 
[FONT=Courier New]Sub delete()
 Dim lr, i&
 lr = Sheet2.Range("a" & Rows.Count).End(xlUp).Row
 
 With Sheet2
 For i = lr To 1 Step -1
  If Cells(i, "A").Value <> "" Then
   Cells(i, "A").EntireRow.delete
  End If
 Next i
 End With
End Sub
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Try

Rich (BB code):
 With Sheet2
 For i = lr To 1 Step -1
  If .Cells(i, "A").Value <> "" Then
   .Cells(i, "A").EntireRow.delete
  End If
 Next i
 End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,108,969
Messages
5,525,960
Members
409,673
Latest member
Riseee

This Week's Hot Topics

Top