Thread: Macro problem
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
alf bryn alf bryn is offline
external usenet poster
 
Posts: 31
Default Macro problem

Hi

I have in the A column a mixture of text and 0 values. I want to find the
row number of last row that contains text and delete any row below that with
a zero value.

This macro works fine in Excel 2002 (English version)

Sub Macro1()
'
Dim i As Integer

For i = Range("A" & Rows.Count).End(xlUp).Row To 10 Step -1

If Range("A" & Rows.Count).End(xlUp).Value = 0 Then

Range("A" & Rows.Count).End(xlUp).ClearContents

End If

Next i

Range("L89") = Range("A" & Rows.Count).End(xlUp).Row

End Sub

When I run this macro at work (Excel 97 with SP2, Swedish version) the line

If Range("A" & Rows.Count).End(xlUp).Value = 0 Then gives me
an error (Nr 13)


Can anybody help me with this problem?

Alf