Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have written a small macro using CurrentRegion where in VBA detects last column and last row in used area and only shades that range. I also color header row differently. I strongly recommend that you store this procedure or your own procedure in VBA project module and create a custom button in a toolbar associated with this procedure. All that you have to do is select any cell in the table and click this button it. The procedure I wrote and use is ( I call it EasyRead named after continuous stationery used for computer printouts ) Sub EasyRead() Dim MyArea As Object Set MyArea = ActiveCell.CurrentRegion ColNum = MyArea.Columns.Count RowNum = MyArea.Rows.Count FirstCol = MyArea.Column FirstRow = MyArea.Row OddFlag = True With Range(Cells(FirstRow, FirstCol), Cells(FirstRow, FirstCol + ColNum - 1)) ..Interior.ColorIndex = 40 ..Font.Bold = True End With For i = 1 To RowNum - 1 Set NewRow = Range(Cells(FirstRow + i, FirstCol), Cells(FirstRow + i, FirstCol + ColNum - 1)) If OddFlag = True Then NewRow.Interior.ColorIndex = 2 Else NewRow.Interior.ColorIndex = 20 End If OddFlag = Not (OddFlag) Next i With MyArea.Borders ..LineStyle = xlContinuous ..Weight = xlThin ..ColorIndex = xlAutomatic End With End Sub -- avveerkar ------------------------------------------------------------------------ avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338 View this thread: http://www.excelforum.com/showthread...hreadid=503235 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 fil | Excel Discussion (Misc queries) | |||
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) | |||
Browse Forms Controls and change TextBox color based on cell color | Excel Programming |