trouble with simple loop . . .ARGH!

B

Buster

I am a newbie!

I am running a macro to dump timescaledata into excel. I want to bold each
subtotaled row(done with the subtotal command). I cannot for the life of me
figure out what I've done wrong. I want to cycle through the range, and
wherever the text includes the word "Total", bold the entire row.

JEff


==================================================
everything is declared . . . .

Set xlRng = xlRng.Columns("a")
xlRng.Select

For Each cell In xlRng
If Right(cell.Value, 5) = "Total" Then
EntireRow.Select.Font.Bold = True
End If
Next cell
 
F

Fred

Buster, try

Dim cell as Range

For each cell In Range("A1:A1000").cells
If cell.Value Like "*Total*" Then
cell.EntireRow.Font.Bold = True
End If
Next cell

Good luck
Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top