Sub NoIdent()
Dim lR As Long, R As Range
lR = Range("A" & Rows.Count).End(xlUp).Row
Set R = Range("A1", "A" & lR)
For Each C In R
If Not IsEmpty(C) Then
If C.IndentLevel = 0 Then C.EntireRow.Font.Bold = True
End If
Next C
End Sub
Assuming you are using column A for this:
Code:Sub NoIdent() Dim lR As Long, R As Range lR = Range("A" & Rows.Count).End(xlUp).Row Set R = Range("A1", "A" & lR) For Each C In R If Not IsEmpty(C) Then If C.IndentLevel = 0 Then C.EntireRow.Font.Bold = True End If Next C End Sub
JoeMo - thanks for the timely response. I am new to this and appreciate your help.
can you help me add the following commands to my original question?
1 - remove all formatting on the spreadsheet
2- top and bottom borders (and bold) all rows not indented
Thank you!
Removing all formatting from the sheet will remove all indenting (a form of formatting). Then item 2 in your list will result in all rows having non-empty cells in column A having bold font and top & bottom borders. Is that what you want??
BTW, formatting a large number of entire rows causes file size to increase significantly. Why do you need borders all the way across a sheet?
Your reply is rather confusing.disregard my previous posts. Contents are in column A. Is it possible to look to B and if not blank, indent contents?
after running remove all format macro
AAAA
aaaa bbb
aaaa bbb
desired outcome (top and bottom borders)
AAA
-> aaaa bbbbb
-> aaaa bbbbb