Formatting subtotals?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top