Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
I am looking to change a printable area row if a condition is true such as :
If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
How would we know the printable area? How are you defining it?
-- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... I am looking to change a printable area row if a condition is true such as : If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
Tom,
The printable areas are Page 1 - is B6:P16 and page 2 is S6:AH16 Thanks Tom "Tom Ogilvy" wrote: How would we know the printable area? How are you defining it? -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... I am looking to change a printable area row if a condition is true such as : If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
Dim cell as Range, rng as Range
for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom, The printable areas are Page 1 - is B6:P16 and page 2 is S6:AH16 Thanks Tom "Tom Ogilvy" wrote: How would we know the printable area? How are you defining it? -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... I am looking to change a printable area row if a condition is true such as : If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
Tom I tried to copy and past into a module, however I got and "Invalid
outside procedure " error. Do I need a Function prior to the Dim Statement? "Tom Ogilvy" wrote: Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom, The printable areas are Page 1 - is B6:P16 and page 2 is S6:AH16 Thanks Tom "Tom Ogilvy" wrote: How would we know the printable area? How are you defining it? -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... I am looking to change a printable area row if a condition is true such as : If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
Nevermind the comment about the error, I got the VBA to work, However I have numerous sheets for this to cover and it seems the way it is written now, the only way it will work is to open each sheet. Is there a way to have is run on all sheets as soon as the workbook is open? Once again Thanks for your time! "ParTeeGolfer" wrote: Tom I tried to copy and past into a module, however I got and "Invalid outside procedure " error. Do I need a Function prior to the Dim Statement? "Tom Ogilvy" wrote: Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom, The printable areas are Page 1 - is B6:P16 and page 2 is S6:AH16 Thanks Tom "Tom Ogilvy" wrote: How would we know the printable area? How are you defining it? -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... I am looking to change a printable area row if a condition is true such as : If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
Sub MyMacro()
Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next End Sub -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom I tried to copy and past into a module, however I got and "Invalid outside procedure " error. Do I need a Function prior to the Dim Statement? "Tom Ogilvy" wrote: Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom, The printable areas are Page 1 - is B6:P16 and page 2 is S6:AH16 Thanks Tom "Tom Ogilvy" wrote: How would we know the printable area? How are you defining it? -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... I am looking to change a printable area row if a condition is true such as : If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
Is there anyway I can have this macro run automatically when the workbook is
open for each sheet in the workbook? "Tom Ogilvy" wrote: Sub MyMacro() Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next End Sub -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom I tried to copy and past into a module, however I got and "Invalid outside procedure " error. Do I need a Function prior to the Dim Statement? "Tom Ogilvy" wrote: Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom, The printable areas are Page 1 - is B6:P16 and page 2 is S6:AH16 Thanks Tom "Tom Ogilvy" wrote: How would we know the printable area? How are you defining it? -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... I am looking to change a printable area row if a condition is true such as : If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
Private Sub Workbooks_Open()
Dim cell as Range, rng as Range Dim sh as Worksheet for each sh in ThisWorkbook.Worksheets for each cell in sh.Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(sh.Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next Next End Sub go to the VBE and in the project explorer, double click on the ThisWorkbook entry in your project. In the resulting module, in the left drodown (at the top) select Workbook and in the right select Open. This is where you want to place the code so it looks like the above. -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Is there anyway I can have this macro run automatically when the workbook is open for each sheet in the workbook? "Tom Ogilvy" wrote: Sub MyMacro() Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next End Sub -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom I tried to copy and past into a module, however I got and "Invalid outside procedure " error. Do I need a Function prior to the Dim Statement? "Tom Ogilvy" wrote: Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom, The printable areas are Page 1 - is B6:P16 and page 2 is S6:AH16 Thanks Tom "Tom Ogilvy" wrote: How would we know the printable area? How are you defining it? -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... I am looking to change a printable area row if a condition is true such as : If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Row Color
Thanks Tom,
this is exactly what I was looking for. "Tom Ogilvy" wrote: Private Sub Workbooks_Open() Dim cell as Range, rng as Range Dim sh as Worksheet for each sh in ThisWorkbook.Worksheets for each cell in sh.Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(sh.Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next Next End Sub go to the VBE and in the project explorer, double click on the ThisWorkbook entry in your project. In the resulting module, in the left drodown (at the top) select Workbook and in the right select Open. This is where you want to place the code so it looks like the above. -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Is there anyway I can have this macro run automatically when the workbook is open for each sheet in the workbook? "Tom Ogilvy" wrote: Sub MyMacro() Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next End Sub -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom I tried to copy and past into a module, however I got and "Invalid outside procedure " error. Do I need a Function prior to the Dim Statement? "Tom Ogilvy" wrote: Dim cell as Range, rng as Range for each cell in Range("AL6:AL16") if cell.Value = "A" then set rng = Intersect(Range("B6:P16, S6:AH16"), _ cell.EntireRow) rng.Interior.ColorIndex = 45 end if Next -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... Tom, The printable areas are Page 1 - is B6:P16 and page 2 is S6:AH16 Thanks Tom "Tom Ogilvy" wrote: How would we know the printable area? How are you defining it? -- Regards, Tom Ogilvy "ParTeeGolfer" wrote in message ... I am looking to change a printable area row if a condition is true such as : If any cell or cells within the range of AL6:AL16 contains an "A" then change the row containing that "A" (Only the printable area) to the color orange. If not leave as is Is this possable? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Powerpoint / Excel: custom pp RGB color doesn't match identical Excelcustom RGB color | Charts and Charting in Excel | |||
Can't format cell color/text color in Office Excel 2003 in files . | Excel Discussion (Misc queries) | |||
My fill color and font color do not work in Excel Std Edition 2003 | Excel Discussion (Misc queries) | |||
Excel 2003 will not display color fonts or color fill cells | Excel Worksheet Functions | |||
Browse Forms Controls and change TextBox color based on cell color | Excel Programming |