PC Review


Reply
Thread Tools Rate Thread

Code arrangement

 
 
MAX
Guest
Posts: n/a
 
      18th Feb 2010
Hello
I want to arrage the code (below).
Instead I write the "TEAM'S Name" by myself, I want to create a formula or
something else in this code so that when A1>A5 it appears the team's name in
cell A2 and when A1<A5 it appears the team's name in cell A4. Is this
possible?

This is the code:

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("J65").Interior.ColorIndex = 3 Then
Range("J65").Interior.ColorIndex = 5
Range("J65").Value = "TEAM's Name"
ElseIf Range("J65").Interior.ColorIndex = 5 Then
Range("J65").Interior.ColorIndex = 3
Range("J65").Value = "CHAMPIONS 2009-2010"
End If
End Sub

Thanks in advance.
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      19th Feb 2010
Try

Range("J65").Value = IIF(Range("A1")>Range("A5"),Range("A2"),Range("A4"))

--
Jacob


"MAX" wrote:

> Hello
> I want to arrage the code (below).
> Instead I write the "TEAM'S Name" by myself, I want to create a formula or
> something else in this code so that when A1>A5 it appears the team's name in
> cell A2 and when A1<A5 it appears the team's name in cell A4. Is this
> possible?
>
> This is the code:
>
> 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("J65").Interior.ColorIndex = 3 Then
> Range("J65").Interior.ColorIndex = 5
> Range("J65").Value = "TEAM's Name"
> ElseIf Range("J65").Interior.ColorIndex = 5 Then
> Range("J65").Interior.ColorIndex = 3
> Range("J65").Value = "CHAMPIONS 2009-2010"
> End If
> End Sub
>
> Thanks in advance.

 
Reply With Quote
 
MAX
Guest
Posts: n/a
 
      19th Feb 2010
Hi Jacob
This is giving me this:
Compile error
Expected: end of statement.

Sorry for any inconvenience

Thanks.

"Jacob Skaria" wrote:

> Try
>
> Range("J65").Value = IIF(Range("A1")>Range("A5"),Range("A2"),Range("A4"))
>
> --
> Jacob
>
>
> "MAX" wrote:
>
> > Hello
> > I want to arrage the code (below).
> > Instead I write the "TEAM'S Name" by myself, I want to create a formula or
> > something else in this code so that when A1>A5 it appears the team's name in
> > cell A2 and when A1<A5 it appears the team's name in cell A4. Is this
> > possible?
> >
> > This is the code:
> >
> > 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("J65").Interior.ColorIndex = 3 Then
> > Range("J65").Interior.ColorIndex = 5
> > Range("J65").Value = "TEAM's Name"
> > ElseIf Range("J65").Interior.ColorIndex = 5 Then
> > Range("J65").Interior.ColorIndex = 3
> > Range("J65").Value = "CHAMPIONS 2009-2010"
> > End If
> > End Sub
> >
> > Thanks in advance.

 
Reply With Quote
 
MAX
Guest
Posts: n/a
 
      19th Feb 2010
Sorry Mr.Jacob you were right, it works 100%.

Thanks a lot

"Jacob Skaria" wrote:

> Try
>
> Range("J65").Value = IIF(Range("A1")>Range("A5"),Range("A2"),Range("A4"))
>
> --
> Jacob
>
>
> "MAX" wrote:
>
> > Hello
> > I want to arrage the code (below).
> > Instead I write the "TEAM'S Name" by myself, I want to create a formula or
> > something else in this code so that when A1>A5 it appears the team's name in
> > cell A2 and when A1<A5 it appears the team's name in cell A4. Is this
> > possible?
> >
> > This is the code:
> >
> > 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("J65").Interior.ColorIndex = 3 Then
> > Range("J65").Interior.ColorIndex = 5
> > Range("J65").Value = "TEAM's Name"
> > ElseIf Range("J65").Interior.ColorIndex = 5 Then
> > Range("J65").Interior.ColorIndex = 3
> > Range("J65").Value = "CHAMPIONS 2009-2010"
> > End If
> > End Sub
> >
> > 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
which avg arrangement should I choose aaronep@pacbell.net Windows XP Help 4 12th Mar 2008 12:58 AM
which avg arrangement should I choose aaronep@pacbell.net Windows XP Help 1 10th Mar 2008 11:35 PM
arrangement MSNews server Windows Vista General Discussion 2 20th Dec 2007 11:58 AM
Arrangement harvindersingh1 Microsoft Excel Misc 2 18th Apr 2006 07:46 AM
Re-arrangement =?Utf-8?B?V2lsbGlhbQ==?= Microsoft Excel Misc 4 26th Oct 2005 09:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 PM.