Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Please help...

I hate to even ask this question because it will show my lack of knowledge.
I'm a VB virgin if you will. I've looked all over for an answer, but it's
probably so simple that most people already know the answer without having to
ask.

I've got the below simple macro in an Excel spreadsheet. I originally wanted
the macro just to run in column B (hence the range "B2:B65536"), but due to
some changes I need to have a different set of criteria for cells B2:B157,
B158:B65536, C2:C157, C158:C65536, etc. I think I could easily figure out how
to give it the different criteria for the cell color once I can figure out
how to break out the different ranges.

Please excuse my newbiness...

Private Sub worksheet_change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("b2:b65536")) Is Nothing Then
Select Case Target
Case Is < -705863892.1, Is -468187826.7
icolor = 38
Case -635277502.88 To -515006609.38
icolor = 35
Case -705863892.1 To -635277502.89
icolor = 36
Case -515006609.37 To -468187826.7
icolor = 36
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200806/1

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



All times are GMT +1. The time now is 07:47 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"