ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formatting subtotals? (https://www.excelbanter.com/excel-worksheet-functions/113138-formatting-subtotals.html)

Carl

Formatting subtotals?
 
Can anyone tell me if I can format the subtotals? I have a workbook that has
names in one column and codes in the other column. I've had to concatenate
the name and code because a name can have several different codes but
sometimes there is no code at all. So I've put a Subtotal on the
concatenated namecode. The only thing that is put in Bold is the namecode.
None of the number totals are in bold. Is there anyway to do this because
I'm not having to hide the concatenated namecode column because I don't want
anyone to see it.

CLR

Formatting subtotals?
 
Here's a little macro I use to BOLD up the subtotals, and add a space to make
reading easier........it will have to be tweaked for your application but may
shine the light.......

Sub AddRowSubTotalsAssignedTo()
Dim lastrow As Long
Dim r As Long
lastrow = Range("L" & Rows.Count).End(xlUp).Row '"L" is the column that
'contains the GrandTotal
For r = lastrow To 2 Step -1
If InStr(1, Cells(r, 3).Value, "Total") 0 Or _
InStr(1, Cells(r, 8).Value, "Total") 0 Or _
InStr(1, Cells(r, 12).Value, "Total") 0 Then
Range(Cells(r, 1), Cells(r, 30)).Font.Bold = True '30 is number
'of columns from "A" that the macro will BOLD
ActiveSheet.Rows(r + 1).EntireRow.Insert
End If
Next
End Sub

hth
Vaya con Dios,
Chuck, CABGx3




"carl" wrote:

Can anyone tell me if I can format the subtotals? I have a workbook that has
names in one column and codes in the other column. I've had to concatenate
the name and code because a name can have several different codes but
sometimes there is no code at all. So I've put a Subtotal on the
concatenated namecode. The only thing that is put in Bold is the namecode.
None of the number totals are in bold. Is there anyway to do this because
I'm not having to hide the concatenated namecode column because I don't want
anyone to see it.



All times are GMT +1. The time now is 10:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com