Hi There,
I am new to this site and wanted to see if someone could please help.
I have already some code , it is just not looping to the next worksheet.
What I am trying to do is add a bottom border to a row (until last used cell) if the value in column A = "Starting Point"
I am new to this site and wanted to see if someone could please help.
I have already some code , it is just not looping to the next worksheet.
What I am trying to do is add a bottom border to a row (until last used cell) if the value in column A = "Starting Point"
Code:
[COLOR=blue]Sub[/COLOR] Border()
[COLOR=blue]Dim[/COLOR] r [COLOR=blue]As[/COLOR] Range, r2 [COLOR=blue]As[/COLOR] Range
[COLOR=blue]Dim[/COLOR] ws [COLOR=blue]As[/COLOR] Worksheet
[COLOR=blue]For Each[/COLOR] ws [COLOR=blue]In[/COLOR] ThisWorkbook.Worksheets
[COLOR=blue]With[/COLOR] ws
[COLOR=blue]Set[/COLOR] r = .Range("A1:A" & .Range("A" & Rows.Count).End(xlUp).Row)
[COLOR=blue]For Each[/COLOR] r2 [COLOR=blue]In[/COLOR] r
[COLOR=blue]If[/COLOR] r2.Value = "Starting Point" [COLOR=blue]Then[/COLOR]
r2.Select
[COLOR=blue]With[/COLOR] r2
lr = ActiveCell.Row
lc = ActiveCell.End(xlToRight).Column
Range(ActiveCell, Cells(lr, lc)).Select
Selection.borders(xlEdgeBottom).Weight = xlThin
[COLOR=darkgreen]'r = r2 + 1[/COLOR]
[COLOR=blue]End With[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]If[/COLOR]
[COLOR=darkgreen]' Worksheets(ActiveSheet.Index + 1).Select[/COLOR]
[COLOR=blue]Next[/COLOR] r2
[COLOR=darkgreen]' Next[/COLOR]
[COLOR=blue]End With[/COLOR]
[COLOR=blue]Next[/COLOR]
[COLOR=blue]End Sub[/COLOR]