ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there a smart way to select multiple rows based on #2 :) (https://www.excelbanter.com/excel-programming/296942-there-smart-way-select-multiple-rows-based-2-a.html)

mike

Is there a smart way to select multiple rows based on #2 :)
 
Many thanks to Bob Kilmer for his great suggestion in the last question on a similar vein
Does anyone know how to manipulate this "replace" formula to work on cells with a set internal.colorindex value ?

Column("A:A").Selec
Selection.Replace What:="", Replacement:="", LookAt:=xlWhole,
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=True,
ReplaceFormat:=Fals

How do you weave in a "Interior.ColorIndex = 5" as the search criteria ?? Basically, on the same vein as before, if a cell in column "A" has a fill color of "5", for example, then set the value of the ID to "null" - later that whole row can be deleted using "Columns("A:A").SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete Shift:=xlUp

If this is possible, again very curious as would be a neat method. Can't find any decent reference online for this
TI

Mike

Bob Phillips[_6_]

Is there a smart way to select multiple rows based on #2 :)
 
Hi Mike,

The 'standard' way of working with Colorindex is to add a helper column and
derive the colorindex in there. And then do any work on that column. Prob
lem with search and replace of course is that you would want to search on
one column and replace on the other. It would probably be best with a Find
loop and manually replace when found.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mike" wrote in message
...
Many thanks to Bob Kilmer for his great suggestion in the last question on

a similar vein.
Does anyone know how to manipulate this "replace" formula to work on cells

with a set internal.colorindex value ??

Column("A:A").Select
Selection.Replace What:="", Replacement:="", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=True, _
ReplaceFormat:=False

How do you weave in a "Interior.ColorIndex = 5" as the search criteria ??

Basically, on the same vein as before, if a cell in column "A" has a fill
color of "5", for example, then set the value of the ID to "null" - later
that whole row can be deleted using
"Columns("A:A").SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete Shift:=xlUp"

If this is possible, again very curious as would be a neat method. Can't

find any decent reference online for this.
TIA

Mike




mike

Is there a smart way to select multiple rows based on #2 :)
 
Thanks Bob

I'm using a loop now... so I guess I'll stick with that. the helper column sounds like a nice idea... again a nice workaround..
may sneak that in somewhere
Many thanks again

Mike


All times are GMT +1. The time now is 03:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com