Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi All I need some help with a macro to locate the first occurance of text i a list so that I can then select that row and format it ie like a min heading Here's an example: My range (a named range called WIP_Area) goes from A12:K12 and the down, in column A there is a list of text that has the followin categories: Incoming, Work in Progress, On Hold and Other. The rows ar sorted so that each category is grouped. I want to locate the firs occurance of each of these categories in column A (however a categor may not appear at all), then select the range A:K for that row so tha I can then apply a fill / shading to the range. I am sure that this is quite simple when you know how Any help would be appreciated Thanks KS -- ks ----------------------------------------------------------------------- ksp's Profile: http://www.excelforum.com/member.php...nfo&userid=626 View this thread: http://www.excelforum.com/showthread.php?threadid=55088 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi ksp
This should do the trick Public Sub MarkCategory() Dim lRow As Long lRow = 13 Do While Not IsEmpty(Cells(lRow, 1)) If Cells(lRow, 1).Value < Cells(lRow - 1, 1) Then With Range("A" & lRow & ":K" & lRow) .Interior.ColorIndex = 4 End With End If lRow = lRow + 1 Loop End Sub HTH, Executor ksp wrote: Hi All I need some help with a macro to locate the first occurance of text in a list so that I can then select that row and format it ie like a mini heading Here's an example: My range (a named range called WIP_Area) goes from A12:K12 and then down, in column A there is a list of text that has the following categories: Incoming, Work in Progress, On Hold and Other. The rows are sorted so that each category is grouped. I want to locate the first occurance of each of these categories in column A (however a category may not appear at all), then select the range A:K for that row so that I can then apply a fill / shading to the range. I am sure that this is quite simple when you know how Any help would be appreciated Thanks KSP -- ksp ------------------------------------------------------------------------ ksp's Profile: http://www.excelforum.com/member.php...fo&userid=6267 View this thread: http://www.excelforum.com/showthread...hreadid=550885 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thank-you Yes it works perfectly Much Appreciated KS -- ks ----------------------------------------------------------------------- ksp's Profile: http://www.excelforum.com/member.php...nfo&userid=626 View this thread: http://www.excelforum.com/showthread.php?threadid=55088 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Locate data macro | Excel Discussion (Misc queries) | |||
How to locate the value? | Excel Discussion (Misc queries) | |||
locate picture location using macro | Excel Programming | |||
advanced filter macro to locate values via multiple criteria | Excel Programming | |||
Crrection Help for a macro to locate max value cell | Excel Programming |