Please help....bold row based on indent

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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
 
Upvote 0
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!


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
 
Upvote 0
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?
 
Upvote 0
You're right, as I'm sure you are aware. I need to put top and bottom borders on the same rows that are bolded.

I can find another way around the alignment issue - thanks for bringing this to my attention.


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?
 
Upvote 0
Thanks for pointing that out. I can look into how to get around that, my task order is probably incorrect.

I need to put top and bottom borders on the same cells that will be bold. They are subtotals above constituents.
 
Upvote 0
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
 
Upvote 0
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
Your reply is rather confusing.

Is AAA in column A and aaaa bbbb in column B or ?? You still want to bolden font and add top & bottom borders for rows where there is a column A entry that is not indented?? If no entry in A look at B and indent if not already indented (how many levels of indent wanted?)??

Can you post a set of requirements with a bit more specificity?
 
Upvote 0
this works for me... can we add top and bottom borders to the bold rows?


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


</pre>
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,981
Members
448,538
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top