Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
To paste copied data in filtered/visible cells only | Excel Discussion (Misc queries) | |||
countif only visible cells (filtered) | Excel Worksheet Functions | |||
Copy visible cells on Filtered data | Excel Discussion (Misc queries) | |||
average of visible cells in a filtered range | Excel Worksheet Functions | |||
Pasting into Filtered Lists (Visible cells only) | Excel Programming |