Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Add bold font to Totals row?

Hi All............

Here's a piece of code someone on the group was kind enough to do for me and
it works fine. What I would like to know now, is , can it be modified to
also change the Font in that entire row that it finds the string "total" in,
to BOLD? Reason being that the Subtotal titles come out bold by virtue of
the "subtotal function", but the subtotals themselves do not and I would
like them to be bold also.....everything in that row.


Sub AddRowSubTotalsBoth()
'Adds blank rows to the Sub-totaled sheet for easier reading

lastrow = Range("A" & Rows.Count).End(xlUp).Row
For r = lastrow To 8 Step -1
If InStr(1, Cells(r, 3).Value, "Total") 0 Or _
InStr(1, Cells(r, 8).Value, "Total") 0 Then
ActiveSheet.Rows(r + 1).EntireRow.Insert

End If
Next
End Sub


TIA,
Vaya con Dios,
Chuck, CABGx3



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Add bold font to Totals row?

Hi Chuck,

Try:

Sub AddRowSubTotalsBoth()
'Adds blank rows to the Sub-totaled sheet for easier reading
Dim lastrow As Long
Dim r As Long

lastrow = Range("A" & Rows.Count).End(xlUp).Row
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 Then
Range(Cells(r, 1), Cells(r, 10)).Font.Bold = True
ActiveSheet.Rows(r + 1).EntireRow.Insert

End If
Next
End Sub

---
Regards,
Norman


"CLR" wrote in message
...
Hi All............

Here's a piece of code someone on the group was kind enough to do for me

and
it works fine. What I would like to know now, is , can it be modified to
also change the Font in that entire row that it finds the string "total"

in,
to BOLD? Reason being that the Subtotal titles come out bold by virtue of
the "subtotal function", but the subtotals themselves do not and I would
like them to be bold also.....everything in that row.


Sub AddRowSubTotalsBoth()
'Adds blank rows to the Sub-totaled sheet for easier reading

lastrow = Range("A" & Rows.Count).End(xlUp).Row
For r = lastrow To 8 Step -1
If InStr(1, Cells(r, 3).Value, "Total") 0 Or _
InStr(1, Cells(r, 8).Value, "Total") 0 Then
ActiveSheet.Rows(r + 1).EntireRow.Insert

End If
Next
End Sub


TIA,
Vaya con Dios,
Chuck, CABGx3





  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Add bold font to Totals row?

Thanks Norman, but it would not change the entire row, only the first 10
columns, until I changed the Cells(r, 10) to Cells(r,30).........now it
covers the range of columns I need...........

Thanks again...........

Vaya con Dios,
Chuck, CABGx3



"Norman Jones" wrote in message
...
Hi Chuck,

Try:

Sub AddRowSubTotalsBoth()
'Adds blank rows to the Sub-totaled sheet for easier reading
Dim lastrow As Long
Dim r As Long

lastrow = Range("A" & Rows.Count).End(xlUp).Row
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 Then
Range(Cells(r, 1), Cells(r, 10)).Font.Bold = True
ActiveSheet.Rows(r + 1).EntireRow.Insert

End If
Next
End Sub

---
Regards,
Norman


"CLR" wrote in message
...
Hi All............

Here's a piece of code someone on the group was kind enough to do for me

and
it works fine. What I would like to know now, is , can it be modified

to
also change the Font in that entire row that it finds the string "total"

in,
to BOLD? Reason being that the Subtotal titles come out bold by virtue

of
the "subtotal function", but the subtotals themselves do not and I would
like them to be bold also.....everything in that row.


Sub AddRowSubTotalsBoth()
'Adds blank rows to the Sub-totaled sheet for easier reading

lastrow = Range("A" & Rows.Count).End(xlUp).Row
For r = lastrow To 8 Step -1
If InStr(1, Cells(r, 3).Value, "Total") 0 Or _
InStr(1, Cells(r, 8).Value, "Total") 0 Then
ActiveSheet.Rows(r + 1).EntireRow.Insert

End If
Next
End Sub


TIA,
Vaya con Dios,
Chuck, CABGx3







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Add bold font to Totals row?

Hi Chuck,

I changed the Cells(r, 10) to Cells(r,30).........


Thats fine. In using Cells(r,10) I made a guess at your data layout adding
two columns to the largest value shown in your code snippet.
I should, of course, have identified my guess.

---
Regards,
Norman
"CLR" wrote in message
...
Thanks Norman, but it would not change the entire row, only the first 10
columns, until I changed the Cells(r, 10) to Cells(r,30).........now it
covers the range of columns I need...........

Thanks again...........

Vaya con Dios,
Chuck, CABGx3



"Norman Jones" wrote in message
...
Hi Chuck,

Try:

Sub AddRowSubTotalsBoth()
'Adds blank rows to the Sub-totaled sheet for easier reading
Dim lastrow As Long
Dim r As Long

lastrow = Range("A" & Rows.Count).End(xlUp).Row
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 Then
Range(Cells(r, 1), Cells(r, 10)).Font.Bold = True
ActiveSheet.Rows(r + 1).EntireRow.Insert

End If
Next
End Sub

---
Regards,
Norman


"CLR" wrote in message
...
Hi All............

Here's a piece of code someone on the group was kind enough to do for

me
and
it works fine. What I would like to know now, is , can it be modified

to
also change the Font in that entire row that it finds the string

"total"
in,
to BOLD? Reason being that the Subtotal titles come out bold by

virtue
of
the "subtotal function", but the subtotals themselves do not and I

would
like them to be bold also.....everything in that row.


Sub AddRowSubTotalsBoth()
'Adds blank rows to the Sub-totaled sheet for easier reading

lastrow = Range("A" & Rows.Count).End(xlUp).Row
For r = lastrow To 8 Step -1
If InStr(1, Cells(r, 3).Value, "Total") 0 Or _
InStr(1, Cells(r, 8).Value, "Total") 0 Then
ActiveSheet.Rows(r + 1).EntireRow.Insert

End If
Next
End Sub


TIA,
Vaya con Dios,
Chuck, CABGx3









  #5   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Add bold font to Totals row?

Not a problem Norman...........

Your code got me to where I needed to be, and I do appreciate it. I could
not have done it without your kind assistance.

Thanks again,
Vaya con Dios,
Chuck, CABGx3


"Norman Jones" wrote in message
...
Hi Chuck,

I changed the Cells(r, 10) to Cells(r,30).........


Thats fine. In using Cells(r,10) I made a guess at your data layout adding
two columns to the largest value shown in your code snippet.
I should, of course, have identified my guess.

---
Regards,
Norman
"CLR" wrote in message
...
Thanks Norman, but it would not change the entire row, only the first 10
columns, until I changed the Cells(r, 10) to Cells(r,30).........now it
covers the range of columns I need...........

Thanks again...........

Vaya con Dios,
Chuck, CABGx3



"Norman Jones" wrote in message
...
Hi Chuck,

Try:

Sub AddRowSubTotalsBoth()
'Adds blank rows to the Sub-totaled sheet for easier reading
Dim lastrow As Long
Dim r As Long

lastrow = Range("A" & Rows.Count).End(xlUp).Row
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 Then
Range(Cells(r, 1), Cells(r, 10)).Font.Bold = True
ActiveSheet.Rows(r + 1).EntireRow.Insert

End If
Next
End Sub

---
Regards,
Norman


"CLR" wrote in message
...
Hi All............

Here's a piece of code someone on the group was kind enough to do fo

r
me
and
it works fine. What I would like to know now, is , can it be

modified
to
also change the Font in that entire row that it finds the string

"total"
in,
to BOLD? Reason being that the Subtotal titles come out bold by

virtue
of
the "subtotal function", but the subtotals themselves do not and I

would
like them to be bold also.....everything in that row.


Sub AddRowSubTotalsBoth()
'Adds blank rows to the Sub-totaled sheet for easier reading

lastrow = Range("A" & Rows.Count).End(xlUp).Row
For r = lastrow To 8 Step -1
If InStr(1, Cells(r, 3).Value, "Total") 0 Or _
InStr(1, Cells(r, 8).Value, "Total") 0 Then
ActiveSheet.Rows(r + 1).EntireRow.Insert

End If
Next
End Sub


TIA,
Vaya con Dios,
Chuck, CABGx3













Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make pivot table sub-totals bold? Neville Bailey Excel Discussion (Misc queries) 5 May 14th 08 07:00 PM
Bold font for Location Totals pm Excel Discussion (Misc queries) 5 April 10th 07 05:20 PM
How do I bold just the totals when using Subtotals? Victor Excel Worksheet Functions 2 March 20th 07 04:15 PM
Bold the totals of a sub-total. sassyvh Setting up and Configuration of Excel 0 February 27th 05 02:43 AM
Are sub-totals able to be set to be bold automatically? Ellie Excel Discussion (Misc queries) 1 February 2nd 05 01:31 PM


All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"