Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Changing visible (filtered) cells

Hello group,

I'm using the following code on a selected range to change the cell value
into "paid"

Worksheets("sales").Range("invoices").Select

For Each cell In Selection
If Not IsEmpty(cell.Value) Then
If cell.Value < "Paid" Then
cell.Value = "Paid"
End If
End If
Next cell

However I would also like it to work when the range is filtered, meaning
only on the visible cells.

I hope someone can get me going

Thanks

Edwin


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Changing visible (filtered) cells

Try this:

==============
Range("A1:D25").SpecialCells(xlCellTypeVisible).Se lect
====================
For Each cell In
Worksheets("sales").Range("invoices").SpecialCells (xlCellTypeVisible)
=================
--
steveB

Remove "AYN" from email to respond
"Edwin Niemoller" wrote in message
...
Hello group,

I'm using the following code on a selected range to change the cell value
into "paid"

Worksheets("sales").Range("invoices").Select

For Each cell In Selection
If Not IsEmpty(cell.Value) Then
If cell.Value < "Paid" Then
cell.Value = "Paid"
End If
End If
Next cell

However I would also like it to work when the range is filtered, meaning
only on the visible cells.

I hope someone can get me going

Thanks

Edwin




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Changing visible (filtered) cells

Thanks Steve, works like a charm!

Edwin

"STEVE BELL" wrote in message
news:Qn0qe.16127$yS2.11442@trnddc07...
Try this:

==============
Range("A1:D25").SpecialCells(xlCellTypeVisible).Se lect
====================
For Each cell In
Worksheets("sales").Range("invoices").SpecialCells (xlCellTypeVisible)
=================
--
steveB

Remove "AYN" from email to respond
"Edwin Niemoller" wrote in message
...
Hello group,

I'm using the following code on a selected range to change the cell

value
into "paid"

Worksheets("sales").Range("invoices").Select

For Each cell In Selection
If Not IsEmpty(cell.Value) Then
If cell.Value < "Paid" Then
cell.Value = "Paid"
End If
End If
Next cell

However I would also like it to work when the range is filtered, meaning
only on the visible cells.

I hope someone can get me going

Thanks

Edwin






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Changing visible (filtered) cells

Glad to be of help...

Happy Exceling...

P.S.
I got the code by recording a macro, than editing it...

--
steveB

Remove "AYN" from email to respond
"Edwin Niemoller" wrote in message
...
Thanks Steve, works like a charm!

Edwin

"STEVE BELL" wrote in message
news:Qn0qe.16127$yS2.11442@trnddc07...
Try this:

==============
Range("A1:D25").SpecialCells(xlCellTypeVisible).Se lect
====================
For Each cell In
Worksheets("sales").Range("invoices").SpecialCells (xlCellTypeVisible)
=================
--
steveB

Remove "AYN" from email to respond
"Edwin Niemoller" wrote in message
...
Hello group,

I'm using the following code on a selected range to change the cell

value
into "paid"

Worksheets("sales").Range("invoices").Select

For Each cell In Selection
If Not IsEmpty(cell.Value) Then
If cell.Value < "Paid" Then
cell.Value = "Paid"
End If
End If
Next cell

However I would also like it to work when the range is filtered,
meaning
only on the visible cells.

I hope someone can get me going

Thanks

Edwin








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
To paste copied data in filtered/visible cells only Hamad Excel Discussion (Misc queries) 1 April 3rd 09 01:49 AM
countif only visible cells (filtered) [email protected] Excel Worksheet Functions 8 August 16th 07 04:39 PM
Copy visible cells on Filtered data [email protected] Excel Discussion (Misc queries) 4 July 18th 07 08:18 AM
average of visible cells in a filtered range dave roth Excel Worksheet Functions 5 May 23rd 05 12:56 PM
Pasting into Filtered Lists (Visible cells only) SuperJas Excel Programming 1 February 17th 04 03:08 AM


All times are GMT +1. The time now is 06:43 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"