Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
HI Bob
After a good nights sleep and reading your post and studying this worksheet further this is what I have determined I need to change: the first criteria is whether F2:IV2 is numeric or not. IF numeric the case select should be based on F3:IV3. If F2:IV2="CAR" then the case select should be based on F4:IV4. The ColorCell function then colors Row2:17 based on the case select. So, if f2=1 and F3=Cat then F2:F17 cell color is 39 and if g2=Car and F4 =dog, then F2:F17 cell color is 40. This is slightly different from the original posting but I think i more clearly illustrates what I am trying to accomplish Thanks for your help! K "Bob Phillips" wrote: So do you want it to use the alternate range if there is (at least) one instance of CAR, or every cell is CAR? -- HTH RP (remove nothere from the email address if mailing direct) "Kelly" wrote in message ... Yes,The value in F1:IV1 will either be "CAR" or a numeric value. Thanks for your help! kelly "Bob Phillips" wrote: "Kelly" wrote in message ... Hello I am trying to modify existing code On Error GoTo ws_exit: Application.EnableEvents = False For Each cell In Me.Range("F2:IV2") Select Case UCase(cell.Value) Case "Cat": ColorCell UCase(cell.Value), cell, 39 Case "Dog": ColorCell UCase(cell.Value), cell, 40 Case "Fish": ColorCell UCase(cell.Value), cell, 35 Case "Horse": ColorCell UCase(cell.Value), cell, 36 End Select Next WS_exit The cases will be the same Cat,Dog,Fish,Horse. However if F1:IV1 = "CAR" me.range is F2:IV2 and if F1:IV1= Numeric then me.range is F3:IV3 I am not sure what that means. Does F1:IV1 ="CAR" mean that every cell is that value? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select case | Excel Discussion (Misc queries) | |||
Select case | Excel Discussion (Misc queries) | |||
Case Select | Excel Worksheet Functions | |||
Case without Select Case error problem | Excel Discussion (Misc queries) | |||
Need help on Select Case | Excel Worksheet Functions |