#1   Report Post  
Posted to microsoft.public.excel.programming
CAM CAM is offline
external usenet poster
 
Posts: 65
Default Underline

Hello,

I have a worksheet that I want to put a border line on top of summary
amounts from column A to J I want this done only when there is a text in
column A that contains "Total" For every text that has "Total" in column A
I want to have the border line. There are many "Totals" in the worksheet
and I don't want to manually put the border line. How do I do that in vba.
I am using Excel 2007 any tips will be appreciated. Thank you in advance.

Cheers

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Underline

On Thu, 19 Feb 2009 21:38:06 -0800, "CAM" wrote:

Hello,

I have a worksheet that I want to put a border line on top of summary
amounts from column A to J I want this done only when there is a text in
column A that contains "Total" For every text that has "Total" in column A
I want to have the border line. There are many "Totals" in the worksheet
and I don't want to manually put the border line. How do I do that in vba.
I am using Excel 2007 any tips will be appreciated. Thank you in advance.


Sub UnderlineTotal()

Dim rCell As Range

For Each rCell In Sheet1.UsedRange.Columns(1).Cells
If rCell.Value = "Total" Then
rCell.Resize(1, 10).Borders(xlEdgeTop).LineStyle = xlContinuous
End If
Next rCell

End Sub
--
Dick
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
Underline Arun Excel Discussion (Misc queries) 3 May 12th 07 07:00 PM
underline TQ Excel Discussion (Misc queries) 3 August 21st 06 04:37 AM
Borders nor underline commands remove an unusual underline. ?? VideoFreak Excel Discussion (Misc queries) 4 February 11th 06 08:17 PM
Underline Carole Drake New Users to Excel 10 April 25th 05 07:09 PM
Underline Todd Huttenstine Excel Programming 1 November 1st 04 12:15 AM


All times are GMT +1. The time now is 04:24 PM.

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

About Us

"It's about Microsoft Excel"