Hi:
I am trying to peice together a code but am having some difficulties due to my VBA Ignorance
What I want to do is that if there is data in cell A of any given row then place a border around A:I of that row.
I then need to go to the cell Containing the word "Total" and OFFSET 1 cell to the right and sum up the $$$ in cell from Row 2 down to where the formula is being inserted.
Quite posdsibly I am going about this the wrong way.
Any guidance or links would be GREATLY Appreciated.
THANKS,
Mark
I am trying to peice together a code but am having some difficulties due to my VBA Ignorance
What I want to do is that if there is data in cell A of any given row then place a border around A:I of that row.
I then need to go to the cell Containing the word "Total" and OFFSET 1 cell to the right and sum up the $$$ in cell from Row 2 down to where the formula is being inserted.
Code:
Sub Borders()
Dim myLastRow As Long
Dim i As Long
'Dim myFormula As String
i = Range("A1").End(xlDown).Row
' Find last row with data in column A
myLastRow = Cells(Rows.Count, "A").End(xlUp).Row
' Select A to I and palce borders around the selection (NOT WORKING)
Range("A:I" & i).Select
With Selection.FormatConditions(1).Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
'Insert Formula to ADD up column H
'RECORDED with Macro Recorder
Cells.Find(What:="Total", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
Range("H9").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-7]C:R[-1]C)"
End Sub
Any guidance or links would be GREATLY Appreciated.
THANKS,
Mark