Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a bold line

Status
Not open for further replies.

Navvy

Technical User
Apr 12, 2002
64
US
Hi all...

Could you possibly tell me how to add a bold line in Excel. My code is as follows:

Sub Clear_Fields()

Dim Store_NB As Long
Dim Store_Instrument As String

Set FixWS = Workbooks("My.xls").Worksheets("ABC")

rr = 2
Store_NB = Cells(rr, 1).Value
Store_Instrument = Cells(rr, 2).Value

rr = rr + 1

While (FixWS.Cells(rr, 1).Value <> &quot;&quot;)
If (FixWS.Cells(rr, 1).Value = Store_NB) Then
FixWS.Cells(rr, 1).ClearContents
FixWS.Cells(rr, 2).ClearContents
Else
Store_NB = Cells(rr, 1).Value
Store_Instrument = Cells(rr, 2).Value
End If
rr = rr + 1
Wend

End Sub


....so, each time a new Store_NB is found I would like a line added above it across the sheet. This will make it slightly more presentable and differentiate between values.

I've tried inserting a macro, but that looks messy!
 
...
else
With Rows(rr & &quot;:&quot; & rr).Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
...
 
Thanks Ide...that worked perfectly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top