ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is ther a way to change the interior.colorindex of multiple rows (https://www.excelbanter.com/excel-programming/294100-ther-way-change-interior-colorindex-multiple-rows.html)

sdnicsm

Is ther a way to change the interior.colorindex of multiple rows
 
Is there a way to change the colorindex of rows based upon the result o
a vba find then collapse the ones that are not results of the find??
Ex:

toy1234
toy2
toy1 is cool
toy3
toy4
toy1 is nerdy

All of the rows to changeinterior color are the ....toy1*
then hide the rest. Seems easy but I haven't gotten it to work.

thnx
sdnics

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Is ther a way to change the interior.colorindex of multiple rows
 
Here's one way

Dim cRows As Long

With ActiveSheet
.Range("A1").EntireRow.Insert
cRows = .Cells(Rows.Count, "A").End(xlUp).Row
.Columns("A:A").AutoFilter Field:=1, Criteria1:="=toy1*",
Operator:=xlAnd
.Rows("2:" &
cRows).SpecialCells(xlCellTypeVisible).EntireRow.I nterior.ColorIndex = 35
End With


--

HTH

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

"sdnicsm " wrote in message
...
Is there a way to change the colorindex of rows based upon the result of
a vba find then collapse the ones that are not results of the find??
Ex:

toy1234
toy2
toy1 is cool
toy3
toy4
toy1 is nerdy

All of the rows to changeinterior color are the ....toy1*
then hide the rest. Seems easy but I haven't gotten it to work.

thnx
sdnicsm


---
Message posted from http://www.ExcelForum.com/




Patrick Molloy

Is ther a way to change the interior.colorindex of multiple rows
 
try to use a filter with a custom setting - begins with
--
Patrick Molloy
Microsoft Excel MVP

"sdnicsm " wrote in message
...
Is there a way to change the colorindex of rows based upon the result of
a vba find then collapse the ones that are not results of the find??
Ex:

toy1234
toy2
toy1 is cool
toy3
toy4
toy1 is nerdy

All of the rows to changeinterior color are the ....toy1*
then hide the rest. Seems easy but I haven't gotten it to work.

thnx
sdnicsm


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 12:07 PM.

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