Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you for this code. It's very close to what I need. Is it possible for
the code to treat a subtitle column as non-data cells? The same way it treats A1:B2? Currently, A1:B2 are non-data cells, and when I click on them, the titles all retain their original formatting. I have a few intermittent headings (as both column titles and row titles) that I would like to format differently from the rest of the titles. So it would look like this: A B C D E F G 1 *C.Head1 C.Title1a C.Title1b *C.Head2 C.Title2a C.Title2b 2 *R.Head1 3 R.Title1a 4 R.Title1b 5 *R.Head2 6 R.Title2a 7 R.Title2b The * denotes a heading with a different formatting (greyed, font size, bold) than the surrounding titles. I would like these cells to remain the same while all of the rest of the titles change exactly as you coded. However, the headings are not periodically spaced as shown above. I'd like the code to somehow check the cell formatting before changing it. Can this be done? "JE McGimpsey" wrote: One way: Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Const cnBASEFONTSIZE As Long = 10 Const cnSELECTEDFONTSIZE As Long = 12 Const csCOLHEADS As String = "C1:AT1" Const csROWHEADS As String = "A3:A54" Dim rFormat As Range With Union(Range(csCOLHEADS), Range(csROWHEADS)).Font .Bold = False .Size = cnBASEFONTSIZE End With On Error Resume Next Set rFormat = Intersect(Range(csCOLHEADS), Target.EntireColumn) If Not rFormat Is Nothing Then With rFormat.Font .Bold = True .Size = cnSELECTEDFONTSIZE End With End If Set rFormat = Intersect(Range(csROWHEADS), Target.EntireRow) If Not rFormat Is Nothing Then With rFormat.Font .Bold = True .Size = cnSELECTEDFONTSIZE End With End If End Sub In article , dschanak wrote: Here's my question in more detail. I'm sorry, I would never intend on wasting anyone's time. I have data from C3:AT54. My titles are in A3:A54 for the row titles and column titles are C1:AT1. I would like to bold the current row/column titles and increase the font size by 2 pts. No color changes. This would apply only when I'm selecting inside the data range. Another thing that's not quite as big of a deal but could be cool if it could be worked around is that I have a couple of row titles and column titles intermittently throughout the data range. I have these rows/columns greyed and the titles bolded, and I would like to make sure that they don't get changed as I'm clicking throught the data range, ie if I happen to click in that row/column and then it automatically changes my desired setting. Can you help me? "JE McGimpsey" wrote: In article , dschanak wrote: If you have any feedback to that thread, please respond on it. I'll pass. If you waste my time by starting another thread, rather than responding to this one, I won't waste more trying to find the new one... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I change the color of the Row and Column ID highlight colo. | Excel Discussion (Misc queries) | |||
Showing the column of current day | Excel Worksheet Functions | |||
Current Cell Color | Excel Worksheet Functions | |||
Protected cells -automatically format to a different color | Excel Discussion (Misc queries) | |||
getting data from 2 excel sheets automatically | Excel Worksheet Functions |