Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default nested loops trouble

Thanks crispbd for your answer. I'm looking for different values in column B,
if value is = (P, Na, Ca, etc.) then look through the columns and check for
the upper limits
ColB
P 'Check if values are 5000
Na 'Check if values are 5500
Ca 'Check if values are 500

if value is bigger than limit, set interior.ColorIndex to 44
My problem is once I found the value in column B (by looping through the
rows) check values through the columns. I started thinking I'm using the
wrong approach...


"crispbd" wrote:


I don't think you need nested loops to make this work (if i understand
your question correctly). You simply want to look through column B for
either value errors or for values over 5000 and if found, make the
cells orange?

Dim PaintColor As Integer
Dim RowCount As Long
Dim InterestedCol As Integer
Dim MyCell As Object

On Error Resume Next

PaintColor = 46
InterestedCol = 2

For RowCount = 1 To UsedRange.Rows.Count
Set MyCell = Cells(RowCount, InterestedCol)

If IsError(MyCell.Value) Or MyCell.Value 5000 Then
MyCell.Interior.ColorIndex = PaintColor
End If

Next RowCount


--
crispbd
------------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...o&userid=10880
View this thread: http://www.excelforum.com/showthread...hreadid=274070


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
Help with nested for loops [email protected] Excel Discussion (Misc queries) 5 May 2nd 07 05:30 PM
Help with nested for loops [email protected] Excel Worksheet Functions 5 May 2nd 07 05:30 PM
Max limit of 7 nested loops Subu Excel Worksheet Functions 2 May 28th 05 02:14 PM
Help on nested loops Jan Lukszo Excel Programming 1 July 29th 04 08:41 AM
Nested loops?? CG Rosén Excel Programming 1 June 22nd 04 08:07 PM


All times are GMT +1. The time now is 04:10 PM.

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

About Us

"It's about Microsoft Excel"