Consulting

Results 1 to 6 of 6

Thread: Flashing Cell

  1. #1
    VBAX Newbie
    Joined
    May 2008
    Posts
    2
    Location

    Flashing Cell

    Hi Guys,

    I am in the process of creating a spreadsheet which gives an different textual outcomes on a particular cell. The possible out comes are:
    Stop
    Go
    Stay
    Cut
    I would like this cell to be flashing with the above outcome in different colours. eg: Stop to be flashing in red colour cell, go to be flashing in green colour cell and stay to be flashing in yellow coloured cell etc.
    Is there a coding that you guys can help me with which will make this easy. Thanks in advance.

    Nouman

  2. #2
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    Something along these lines might be the right direction.
    [VBA]Dim counter As Integer
    counter = 1
    Range("A1:A1").Select
    Do
    If (Selection = "GO") Then
    Selection.Interior.ColorIndex = 4
    Application.Wait Now() + TimeValue("00:00:01")
    End If
    If (Selection = "Stop") Then
    Selection.Interior.ColorIndex = 3
    Application.Wait Now() + TimeValue("00:00:01")
    End If

    If (Selection = "Stay") Then
    Selection.Interior.ColorIndex = 6
    Application.Wait Now() + TimeValue("00:00:01")
    End If

    If (Selection = "Stop") Then
    Selection.Interior.ColorIndex = 8
    Application.Wait Now() + TimeValue("00:00:01")
    End If

    Selection.Interior.ColorIndex = 0
    Application.Wait Now() + TimeValue("00:00:01")
    Loop Until counter <> 1[/VBA]

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I would strongly advise you not to do this.

    In the first instance, it will annoy people, and annoyed people do not make good users.

    In the second instance, it some countries/states, it may even be illegal under the terms of disabled persons legislation.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    Hmm -- apart from the annoying factor, as a matter of practice, how do you get a result like this? I don't know how to make something just run in the background like this example.

  5. #5
    VBAX Newbie
    Joined
    May 2008
    Posts
    2
    Location
    Gavin - Thanks for your code but I am a beginner. Will this be the coding to be inserted in VB by pressing ALT+F11 or in the edit coding of the cell?

  6. #6
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    Mine doesn't work exactly right. This code just would run at running of the macro not on the change in the word in the cell. It would need to go in a module in the editor (alt f11). Right click insert module.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •