Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default If *Total* make row white

What happens when you run it?

What did you want to happen when you ran it?

This line looks for an exact match in upper/lower case:
If (Cells(j, 5).Value) Like "*Total*" Then

Maybe ignoring case is what you want:
If lcase(Cells(j, 5).Value) Like lcase("*Total*") Then

If you have errors in column E, then this line will fail:
If Cells(j, 5).Value Like "*Total*" Then
(I remove those extra ()'s.)

If you wanted some different formatting, record a macro when you do it manually
to get the syntax and replace this line:

Rows(j).Interior.ColorIndex = xlNone

With some modified version of your recorded code.

ryguy7272 wrote:

I grabbed this from another macro that I have:
Dim lastrow As Long, j As Long
lastrow = Cells(Rows.Count, 5).End(xlUp).Row
For j = lastrow To 1 Step -1
If (Cells(j, 5).Value) Like "*Total*" Then
Rows(j).Interior.ColorIndex = xlNone
End If
Next

Other macro worked great, but the way. I tried to white out each row, and
now it doesn't work. Been looking at all kinds of code for about 10 hours
now. My eyes need a rest. Can someone see the problem?

Thanks!
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If *Total* make row white marcus[_3_] Excel Programming 1 December 11th 09 02:31 AM
If *Total* make row white J_Knowles[_2_] Excel Programming 0 December 11th 09 01:00 AM
Make row white unless the value of a certain cell is 0 Josh Excel Discussion (Misc queries) 6 August 11th 09 03:43 PM
How do I make a total sheet? Tia Charts and Charting in Excel 1 September 13th 07 10:31 PM
EXCEL workbook is off-white, goes white in edit mode Joe Excel Discussion (Misc queries) 0 July 15th 06 12:45 PM


All times are GMT +1. The time now is 11:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"