Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default Code arrangement

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 A1A5 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Code arrangement

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 A1A5 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default Code arrangement

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 A1A5 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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default Code arrangement

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 A1A5 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
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
Arrangement problems. Blah Excel Discussion (Misc queries) 6 April 25th 06 11:56 AM
Arrangement harvindersingh1 Excel Discussion (Misc queries) 2 April 18th 06 07:46 AM
Data Arrangement tbobo Excel Discussion (Misc queries) 3 March 23rd 06 02:50 PM
Re-arrangement William Excel Discussion (Misc queries) 4 October 26th 05 09:11 AM
Worksheet re-arrangement Malcolm Brown Excel Worksheet Functions 2 November 13th 04 10:09 AM


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