PC Review


Reply
Thread Tools Rate Thread

Arrange code

 
 
MAX
Guest
Posts: n/a
 
      18th Apr 2010
Hello
I have this code (below) which works perfect.
Option Explicit
Dim nextSecond

Sub startFlashing()
flashCell
End Sub

Sub stopFlashing()
On Error Resume Next
Application.OnTime nextSecond, "flashCell", , False
End Sub

Sub flashCell()
nextSecond = Now + TimeValue("00:00:01")
Application.OnTime nextSecond, "flashCell"


If Range("A105").Interior.ColorIndex = 3 Then
Range("A105").Interior.ColorIndex = 5
Range("A105").Value = IIf(Range("F102") = Range("G102"),
Range("A99"), IIf(Range("F102") > Range("G102"), Range("E102"),
Range("H102")))
ElseIf Range("A105").Interior.ColorIndex = 5 Then
Range("A105").Interior.ColorIndex = 3
Range("A105").Value = "CHAMPIONS 2009-2010"
End If
End Sub

Now I need to add something else to it, where if cells F102 and G102 remain
equal, then Range("A105").Value =
Range(J102)>Range(K102),Range(E102),Range(H102).
I appriciate even a small help.
Thanks in advance.
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      18th Apr 2010
then Range("A105").Value =
Range(J102)>Range(K102),Range(E102),Range(H102).


This needs clarification. Did you want an IIf statement

Or

A105 = The greater of J102 Or Sum(E102, H102, K102)

Or

A105 = Sum(E102, H102, J102,K102) assuming the > was a typo.

Or what?






"MAX" <(E-Mail Removed)> wrote in message
news:9D8D40B3-4A2D-413E-8DBE-(E-Mail Removed)...
> Hello
> I have this code (below) which works perfect.
> Option Explicit
> Dim nextSecond
>
> Sub startFlashing()
> flashCell
> End Sub
>
> Sub stopFlashing()
> On Error Resume Next
> Application.OnTime nextSecond, "flashCell", , False
> End Sub
>
> Sub flashCell()
> nextSecond = Now + TimeValue("00:00:01")
> Application.OnTime nextSecond, "flashCell"
>
>
> If Range("A105").Interior.ColorIndex = 3 Then
> Range("A105").Interior.ColorIndex = 5
> Range("A105").Value = IIf(Range("F102") = Range("G102"),
> Range("A99"), IIf(Range("F102") > Range("G102"), Range("E102"),
> Range("H102")))
> ElseIf Range("A105").Interior.ColorIndex = 5 Then
> Range("A105").Interior.ColorIndex = 3
> Range("A105").Value = "CHAMPIONS 2009-2010"
> End If
> End Sub
>
> Now I need to add something else to it, where if cells F102 and G102
> remain
> equal, then Range("A105").Value =
> Range(J102)>Range(K102),Range(E102),Range(H102).
> I appriciate even a small help.
> Thanks in advance.



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      18th Apr 2010
I went ahead with the assumption that you wanted an additional ElseIf
statement. This would be inserted just before the End If.


ElseIf Range("F102") = Range("G102") Then
Range("A105") = IIf(Range("J102") > Range("k102"), _
Range("E102"), Range("H102"))




"MAX" <(E-Mail Removed)> wrote in message
news:9D8D40B3-4A2D-413E-8DBE-(E-Mail Removed)...
> Hello
> I have this code (below) which works perfect.
> Option Explicit
> Dim nextSecond
>
> Sub startFlashing()
> flashCell
> End Sub
>
> Sub stopFlashing()
> On Error Resume Next
> Application.OnTime nextSecond, "flashCell", , False
> End Sub
>
> Sub flashCell()
> nextSecond = Now + TimeValue("00:00:01")
> Application.OnTime nextSecond, "flashCell"
>
>
> If Range("A105").Interior.ColorIndex = 3 Then
> Range("A105").Interior.ColorIndex = 5
> Range("A105").Value = IIf(Range("F102") = Range("G102"),
> Range("A99"), IIf(Range("F102") > Range("G102"), Range("E102"),
> Range("H102")))
> ElseIf Range("A105").Interior.ColorIndex = 5 Then
> Range("A105").Interior.ColorIndex = 3
> Range("A105").Value = "CHAMPIONS 2009-2010"
> End If
> End Sub
>
> Now I need to add something else to it, where if cells F102 and G102
> remain
> equal, then Range("A105").Value =
> Range(J102)>Range(K102),Range(E102),Range(H102).
> I appriciate even a small help.
> Thanks in advance.



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      18th Apr 2010
That got all skewed around, hopefully this will look better and won't wrap
when it posts.


ElseIf Range("F102") = Range("G102") Then
Range("A105") = IIf(Range("J102") > Range("k102"), _
Range("E102"), Range("H102"))



"JLGWhiz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I went ahead with the assumption that you wanted an additional ElseIf
>statement. This would be inserted just before the End If.
>
>
> ElseIf Range("F102") = Range("G102") Then
> Range("A105") = IIf(Range("J102") > Range("k102"), _
> Range("E102"), Range("H102"))
>
>
>
>
> "MAX" <(E-Mail Removed)> wrote in message
> news:9D8D40B3-4A2D-413E-8DBE-(E-Mail Removed)...
>> Hello
>> I have this code (below) which works perfect.
>> Option Explicit
>> Dim nextSecond
>>
>> Sub startFlashing()
>> flashCell
>> End Sub
>>
>> Sub stopFlashing()
>> On Error Resume Next
>> Application.OnTime nextSecond, "flashCell", , False
>> End Sub
>>
>> Sub flashCell()
>> nextSecond = Now + TimeValue("00:00:01")
>> Application.OnTime nextSecond, "flashCell"
>>
>>
>> If Range("A105").Interior.ColorIndex = 3 Then
>> Range("A105").Interior.ColorIndex = 5
>> Range("A105").Value = IIf(Range("F102") = Range("G102"),
>> Range("A99"), IIf(Range("F102") > Range("G102"), Range("E102"),
>> Range("H102")))
>> ElseIf Range("A105").Interior.ColorIndex = 5 Then
>> Range("A105").Interior.ColorIndex = 3
>> Range("A105").Value = "CHAMPIONS 2009-2010"
>> End If
>> End Sub
>>
>> Now I need to add something else to it, where if cells F102 and G102
>> remain
>> equal, then Range("A105").Value =
>> Range(J102)>Range(K102),Range(E102),Range(H102).
>> I appriciate even a small help.
>> Thanks in advance.

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Arrange VBA CODE in Alpha Order dch3 Microsoft Access VBA Modules 7 4th Sep 2008 04:09 AM
vb code to re-arrange data Svenman Microsoft Excel Programming 10 10th Jan 2008 02:12 AM
Help with code to re-arrange data for pareto analysis Steve S Microsoft Excel Programming 2 23rd Feb 2006 06:34 PM
Code to Arrange Remaining Windows after Closing One? Barbara Microsoft Excel Programming 6 8th Mar 2004 08:23 PM
Arrange Icons By -> Auto Arrange Matias Hohl Windows XP General 0 22nd Oct 2003 08:12 AM


Features
 

Advertising
 

Newsgroups
 


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