ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   trouble with simple loop . . .ARGH! (https://www.excelbanter.com/excel-programming/317771-trouble-simple-loop-argh.html)

Buster

trouble with simple loop . . .ARGH!
 
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



fred

trouble with simple loop . . .ARGH!
 
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

"Buster" wrote in message
...
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






All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com