Sub DoZerosInColumnSAS()
Dim i As Long
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Cells(i, 1) = 0 Then Rows(i - 2).Font.Bold = True
Next i
End Sub

Don Guillett
SalesAid Software
dguille...@gmail.com

From: Hayhurst, Glenn A 
Sent: Friday, October 28, 2011 6:00 PM
To: excel-macros@googlegroups.com 
Subject: $$Excel-Macros$$ Find a value in column A and make row above bold

Hi. I am trying to find cells in Column A with a value of “0” and then 
navigating up two rows and making that entire row bold.  It all falls apart 
after I try to use Offset.  Where did I go wrong?

 

Sub BOLDAboveZero()

Dim LR As Long, i As Long

LR = Range("A" & Rows.Count).End(xlUp).Row

For i = LR To 1 Step -1

    With Range("A" & i)

        If .Value = 0 Then .ActiveCell.Offset(-2, 0).Select

Select.EntireRow.Font.Bold=True
    End With

Next i

End Sub

 


-- 
FORUM RULES (925+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.
 
------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (925+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to