Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello - I am new to google groups and coding with VBA. I'm hoping
someone can assist with my problem. I think it is kinda easy, I have a pivot table and within column A there is a entry that contains the word 'total', created by the pivot when creating. What I'm looking to do is hight light this row IF the corisponding cell in column F is a negative number. But if the word TOTAL is found and the number in colmun F is positive then, do nothing. I think this might be done via condional formatting as well but not sure of the syntax. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try:
Sub jeff() For i = 1 To 1000 If InStr(Cells(i, 1).Value, "Total") Then If Cells(i, "F").Value < 0 Then Range(Cells(i, 1), Cells(i, 256)).Interior.ColorIndex = 6 End If End If Next End Sub -- Gary's Student " wrote: Hello - I am new to google groups and coding with VBA. I'm hoping someone can assist with my problem. I think it is kinda easy, I have a pivot table and within column A there is a entry that contains the word 'total', created by the pivot when creating. What I'm looking to do is hight light this row IF the corisponding cell in column F is a negative number. But if the word TOTAL is found and the number in colmun F is positive then, do nothing. I think this might be done via condional formatting as well but not sure of the syntax. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gary....thank you very much. That worked perfectly...well, almost. In
your code you have the cell range to 256. I only needed to go to column G, so with one quicky change from 256 to 7....it worked just fine. Thanks again.... Gary''s Student wrote: Try: Sub jeff() For i = 1 To 1000 If InStr(Cells(i, 1).Value, "Total") Then If Cells(i, "F").Value < 0 Then Range(Cells(i, 1), Cells(i, 256)).Interior.ColorIndex = 6 End If End If Next End Sub -- Gary's Student " wrote: Hello - I am new to google groups and coding with VBA. I'm hoping someone can assist with my problem. I think it is kinda easy, I have a pivot table and within column A there is a entry that contains the word 'total', created by the pivot when creating. What I'm looking to do is hight light this row IF the corisponding cell in column F is a negative number. But if the word TOTAL is found and the number in colmun F is positive then, do nothing. I think this might be done via condional formatting as well but not sure of the syntax. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find value with two conditions | Excel Discussion (Misc queries) | |||
How to find the value with 2 conditions? | Excel Discussion (Misc queries) | |||
Countif Conditions - Use of conditions that vary by cell value | Excel Discussion (Misc queries) | |||
How do I handle error conditions with the FIND command? | Excel Worksheet Functions | |||
shade cells based on conditions - i have more than 3 conditions | Excel Worksheet Functions |