Thread: Many columns
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Darin Kramer Darin Kramer is offline
external usenet poster
 
Posts: 397
Default Many columns


hmm...Im almost there, (but as u can tell am no programmer!), could I
have a bit more assistance.... in telling macro only to look at row 2's
background colour (i dont want to highlight all the backround colours of
the whole column....)

What i have so far is:

Public Sub DoTemplate()


Dim objWS As Excel.Worksheet
Dim objCell As Excel.Range, objR As Excel.Range
Dim I As Byte, K As Byte
Dim J As Long

Set objWS = Sheets("master")
Set objCell = Application.Selection

K = objCell.Row
J = objCell.Interior.ColorIndex

' Hide rows
'For I = 2 To 2

' If I < K Then

' objWS.Rows(I).Hidden = True

' End If

'Next

' Hide columns

For I = 2 To 52

Set objR = objWS.Cells(K, I)
If objR.Interior.ColorIndex < J Then

objWS.Columns(I).Hidden = True

End If




*** Sent via Developersdex http://www.developersdex.com ***