View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
UB UB is offline
external usenet poster
 
Posts: 120
Default Problem using filter property

Thanks Sandy
It worked.

Can you please advise me about goto function.

I want to use it in my if statement

if <condition then

<do
Else
goto next (I want to give a command, that if there is error go to next
block of code)
Endif


CODE CONtinued
"Sandy Mann" wrote:

Use the correct range as in something like:

Set w = Sheets("A")
With w
EndData = .Cells(Rows.Count, 1).End(xlUp).Row
End With

With w.Range("A1:M" & EndData)
AutoFilter field:=11, Criteria1:="S"
End With



--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"ub" wrote in message
...
Hi
I have the following code in my VBA

Set w = Worksheets("A")

w.Cells.AutoFilter field:=11, Criteria1:="S"

It works fine, but it displays the results from row 2 of the sheet.
I have my heading from cell A1 to M4 , so when I use this code the heading
from row a2 : m5 are hidden under the output os the result.
I want the ouput to start from Cell a5.

Please help