Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Help with FOR LOOP and and Advance Filter

I was wondering if it is possible to use a:
For Each c in Range().Cells
to loop through an autofilter range or an advance filter range.

What I am trying to do is run an advance filter in place and use the For
Each c in Range().Cells loop through the filtered data and place the results
of the loop on another sheet in the worrkbook. Is this possible? If so, can
someone place give me an idea how to do this, please?
Thank you
Ayo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Help with FOR LOOP and and Advance Filter

i've used something like this snippet:

Set rng = Range(ws.Cells(2, "D"), ws.Cells(6,
"D").End(xlDown)).SpecialCells(xlCellTypeVisib le)
For Each cell In rng
' do something
Next

--


Gary Keramidas


"Ayo" wrote in message
...
I was wondering if it is possible to use a:
For Each c in Range().Cells
to loop through an autofilter range or an advance filter range.

What I am trying to do is run an advance filter in place and use the For
Each c in Range().Cells loop through the filtered data and place the
results
of the loop on another sheet in the worrkbook. Is this possible? If so,
can
someone place give me an idea how to do this, please?
Thank you
Ayo


  #3   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Help with FOR LOOP and and Advance Filter

Thanks a lot Gary. I think this might do the job.

"Gary Keramidas" wrote:

i've used something like this snippet:

Set rng = Range(ws.Cells(2, "D"), ws.Cells(6,
"D").End(xlDown)).SpecialCells(xlCellTypeVisib le)
For Each cell In rng
' do something
Next

--


Gary Keramidas


"Ayo" wrote in message
...
I was wondering if it is possible to use a:
For Each c in Range().Cells
to loop through an autofilter range or an advance filter range.

What I am trying to do is run an advance filter in place and use the For
Each c in Range().Cells loop through the filtered data and place the
results
of the loop on another sheet in the worrkbook. Is this possible? If so,
can
someone place give me an idea how to do this, please?
Thank you
Ayo



  #4   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Help with FOR LOOP and and Advance Filter

What exactly does this do? I am a bit confused with the Range(ws.Cells(2,
"D"), ws.Cells(6,"D").End(xlDown)) part espeecially the Range(ws.Cells(2,
"D"), ws.Cells(6,"D") part. Can you explain that part to me.
I am guessing that Range(ws.Cells(2, "D"), ws.Cells(6,"D") is the same as
Range(Cells(2, 4), (6,4). Is this correct? And if so, what does the
..End(xlDown) do?

Thanks again for the help.

"Gary Keramidas" wrote:

i've used something like this snippet:

Set rng = Range(ws.Cells(2, "D"), ws.Cells(6,
"D").End(xlDown)).SpecialCells(xlCellTypeVisib le)
For Each cell In rng
' do something
Next

--


Gary Keramidas


"Ayo" wrote in message
...
I was wondering if it is possible to use a:
For Each c in Range().Cells
to loop through an autofilter range or an advance filter range.

What I am trying to do is run an advance filter in place and use the For
Each c in Range().Cells loop through the filtered data and place the
results
of the loop on another sheet in the worrkbook. Is this possible? If so,
can
someone place give me an idea how to do this, please?
Thank you
Ayo



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Help with FOR LOOP and and Advance Filter

it was just an example of how to select a range. the end.down goes down to
the last filled cell and uses that and the last cell in the range. it just
used row 6 as the starting point.

like i said, it was just an example.

--


Gary Keramidas


"Ayo" wrote in message
...
What exactly does this do? I am a bit confused with the Range(ws.Cells(2,
"D"), ws.Cells(6,"D").End(xlDown)) part espeecially the Range(ws.Cells(2,
"D"), ws.Cells(6,"D") part. Can you explain that part to me.
I am guessing that Range(ws.Cells(2, "D"), ws.Cells(6,"D") is the same as
Range(Cells(2, 4), (6,4). Is this correct? And if so, what does the
.End(xlDown) do?

Thanks again for the help.

"Gary Keramidas" wrote:

i've used something like this snippet:

Set rng = Range(ws.Cells(2, "D"), ws.Cells(6,
"D").End(xlDown)).SpecialCells(xlCellTypeVisib le)
For Each cell In rng
' do something
Next

--


Gary Keramidas


"Ayo" wrote in message
...
I was wondering if it is possible to use a:
For Each c in Range().Cells
to loop through an autofilter range or an advance filter range.

What I am trying to do is run an advance filter in place and use the
For
Each c in Range().Cells loop through the filtered data and place the
results
of the loop on another sheet in the worrkbook. Is this possible? If so,
can
someone place give me an idea how to do this, please?
Thank you
Ayo






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
Advance Filter JRey Excel Discussion (Misc queries) 2 November 14th 08 07:01 PM
for loop doesn't advance Janis Excel Programming 3 October 2nd 07 11:29 PM
How to Advance a For Next Loop prior to the Next Statement ExcelMonkey Excel Programming 1 August 9th 05 06:13 PM
Advance filter search does not filter an exact match cfiiland Excel Programming 1 June 10th 05 12:44 PM
Boolean to advance loop ExcelMonkey[_190_] Excel Programming 1 March 14th 05 06:41 PM


All times are GMT +1. The time now is 09:34 PM.

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

About Us

"It's about Microsoft Excel"