Prev Previous Post   Next Post Next
  #1   Report Post  
Paige
 
Posts: n/a
Default IF help


Hello, I am trying to do some IF statements within a larger macro.
What I want to do is delete certain sections of a worksheet depending
on whether they have quantities in them or not. I got an IF statement
to work, but it carried what it needed to do if it was true whether it
was true or false. Right now I have it set up to just change the
background color until I know for sure it works because it helps me
keep track of what is working & not working while I am building the
macros. Below is an example of the IF statments that I can't get to
work the way I want. This is my first attempt at them so they may be
completely wrong.

If R2 = 0 Then
Range("A288:A334").Select
Selection.Interior.ColorIndex = 4
End If

If Q2 = 0 Then
Range("A240:A287").Select
Selection.Interior.ColorIndex = 14
End If

If P2 = 0 Then
Range("A192:A239").Select
Selection.Interior.ColorIndex = 39
End If

Thanks for any help!


--
Paige
------------------------------------------------------------------------
Paige's Profile: http://www.excelforum.com/member.php...o&userid=23096
View this thread: http://www.excelforum.com/showthread...hreadid=386913

 
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



All times are GMT +1. The time now is 04:02 AM.

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"