Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
UB UB is offline
external usenet poster
 
Posts: 120
Default Problem using filter property

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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Problem using filter property

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




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 220
Default Problem using filter property


w.Range(Cells(5, 1), Cells(Rows.Count, 13).End(xlUp)) _
.AutoFilter field:=11, Criteria1:="S"

--
Dan Oakes

  #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





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Problem using filter property

It sounds as if you want:

On Error Resume Next

if you want the code to just continue on or

On Error Goto NextCode
if <condition then

<do

NextCode:
If <another condition then

Where NextCode: is a label, (note the colon and the name can be anything.

To remove the On Error have a line:

On Error Goto 0


--
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
...
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










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

Hi Sandy
My VBA code to filter my data works fine,
W.Range("a3:m100").AutoFilter field:=11, Criteria1:="S"

Is there any way I can count the # of rows that was the output of this
filter results.

Ex, If my filter command gived me 5 rows, I want the answer 5.

Can please advise how I can do this.

Thanks in advance.


"Sandy Mann" wrote:

It sounds as if you want:

On Error Resume Next

if you want the code to just continue on or

On Error Goto NextCode
if <condition then

<do

NextCode:
If <another condition then

Where NextCode: is a label, (note the colon and the name can be anything.

To remove the On Error have a line:

On Error Goto 0


--
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
...
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









  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Problem using filter property

Use the SUBTOTAL() function with 3 as the second argument to count the cells
in Column K which will all have an "S"
--
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 Sandy
My VBA code to filter my data works fine,
W.Range("a3:m100").AutoFilter field:=11, Criteria1:="S"

Is there any way I can count the # of rows that was the output of this
filter results.

Ex, If my filter command gived me 5 rows, I want the answer 5.

Can please advise how I can do this.

Thanks in advance.


"Sandy Mann" wrote:

It sounds as if you want:

On Error Resume Next

if you want the code to just continue on or

On Error Goto NextCode
if <condition then

<do

NextCode:
If <another condition then

Where NextCode: is a label, (note the colon and the name can be anything.

To remove the On Error have a line:

On Error Goto 0


--
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
...
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












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

Hi Sandy
Is there a VBA code I can use.
Thanks

"Sandy Mann" wrote:

Use the SUBTOTAL() function with 3 as the second argument to count the cells
in Column K which will all have an "S"
--
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 Sandy
My VBA code to filter my data works fine,
W.Range("a3:m100").AutoFilter field:=11, Criteria1:="S"

Is there any way I can count the # of rows that was the output of this
filter results.

Ex, If my filter command gived me 5 rows, I want the answer 5.

Can please advise how I can do this.

Thanks in advance.


"Sandy Mann" wrote:

It sounds as if you want:

On Error Resume Next

if you want the code to just continue on or

On Error Goto NextCode
if <condition then

<do

NextCode:
If <another condition then

Where NextCode: is a label, (note the colon and the name can be anything.

To remove the On Error have a line:

On Error Goto 0


--
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
...
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













  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Problem using filter property

Add after your Autofilter code:

MsgBox Range(Cells(1, 11), Cells(EndData,
11)).SpecialCells(xlCellTypeVisible).Count

--
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 Sandy
Is there a VBA code I can use.
Thanks

"Sandy Mann" wrote:

Use the SUBTOTAL() function with 3 as the second argument to count the
cells
in Column K which will all have an "S"
--
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 Sandy
My VBA code to filter my data works fine,
W.Range("a3:m100").AutoFilter field:=11, Criteria1:="S"

Is there any way I can count the # of rows that was the output of this
filter results.

Ex, If my filter command gived me 5 rows, I want the answer 5.

Can please advise how I can do this.

Thanks in advance.


"Sandy Mann" wrote:

It sounds as if you want:

On Error Resume Next

if you want the code to just continue on or

On Error Goto NextCode
if <condition then

<do

NextCode:
If <another condition then

Where NextCode: is a label, (note the colon and the name can be
anything.

To remove the On Error have a line:

On Error Goto 0


--
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
...
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
















Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object property/method problem Ayo Excel Discussion (Misc queries) 6 August 30th 07 10:18 PM
Filter problem Mikeymay Excel Discussion (Misc queries) 4 July 12th 07 08:26 AM
Filter problem cumi Excel Worksheet Functions 1 April 3rd 07 05:10 AM
filter problem strictly_rhythm Excel Discussion (Misc queries) 6 July 4th 06 12:24 PM
Filter problem [email protected] Excel Worksheet Functions 1 November 28th 05 09:10 PM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"