Thread: Data Formatting
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Data Formatting

Hi Programmer wanna be,

Perhaps you do not have a sheet named Sheet1.

Try replacing Sheet1 with the name of your sheet.


---
Regards,
Norman



"Programmer wanna be" wrote in message
m...
Hello.

Using the information below, I am getting the following error "Set ws
= Sheets("Sheet1")". What does that mean?? How do I fix it?

Thank you for all of your help.

"merjet" wrote in message

...
Sub DeleteRows()
Dim iRow As Integer
Dim ws As Worksheet
Set ws = Sheets("Sheet1")
iRow = 1
Do
If ws.Cells(iRow + 1, "A") = ws.Cells(iRow, "A") _
And ws.Cells(iRow + 1, "B") = ws.Cells(iRow, "B") Then
ws.Rows(iRow + 1).Delete
Else
iRow = iRow + 1
End If
Loop Until ws.Cells(iRow + 1, "A") = ""
End Sub

HTH,
Merjet