Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Working on interactive worksheet (need help with highlighting and blinking cell)


Hi there,
I’m trying to create a nice-looking interactive worksheet. I hav
obtained two vba programs from some free websites. This first one let
my cell blink white and purple. Originally it was to make many cells d
that and in multiple colours but I’ve edited it and I’m no
sure if there is any unnecessary lines of code in it. Also, I have
problem, when I quit it closes my whole excel application (includin
other worksheets). If I say cancel with regard to saving in othe
worksheets, for some reason my blinking work sheets re-opens itself (i
will keep doing so unless I disable macros).
Below is the code for the blinking cell (code for ThisWorkBook and cod
in a Module):


----------------ThisWorkBook----------

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Quit
End Sub


Private Sub Workbook_Open()

Call Blink

End Sub



----------------module---------------


Dim BlinkTime As Date

Public Sub Blink()
Dim c As Range

For Each c In Range("C3").Cells
If c.Interior.ColorIndex = 47 Then
If c.Value 100 Then
c.Interior.ColorIndex = 2 'White
ElseIf c.Value 50 Then
c.Interior.ColorIndex = 2 'White
Else
c.Interior.ColorIndex = 2 'White
End If
Else
c.Interior.ColorIndex = 47
End If
Next c


BlinkTime = Now() + TimeValue("00:00:01")
Application.OnTime BlinkTime, "Blink"
End Sub


In addition, I have another vba program code that basically highlight
the row of the selected cell. It works really well because it restore
the any previous colours in cells after I’ve moved it elsewhere.
However if I save the work sheet before quitting, it saves th
highlighted row. The code for this is listed below (I keep it in Shee
9 which is called REPORT).



---------------------Sheet9 (REPORT)----------------

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Const cnNUMCOLS As Long = 256
Const cnHIGHLIGHTCOLOR As Long = 38 'default lt. blue
Static rOld As Range
Static nColorIndices(1 To cnNUMCOLS) As Long
Dim i As Long
If Not rOld Is Nothing Then 'Restore color indices
With rOld.Cells
If .Row = ActiveCell.Row Then Exit Sub 'same row, don'
restore
For i = 1 To cnNUMCOLS
.Item(i).Interior.ColorIndex = nColorIndices(i)
Next i
End With
End If
Set rOld = Cells(ActiveCell.Row, 1).Resize(1, cnNUMCOLS)
With rOld
For i = 1 To cnNUMCOLS
nColorIndices(i) = .Item(i).Interior.ColorIndex
Next i
.Interior.ColorIndex = cnHIGHLIGHTCOLOR
End With
End Sub


What I’d like to do:

1. Get my worksheet to quit properly with regard to the blinking cell.
2. Make the row highlighting only applicable to rows 7 to 100 in m
worksheet.
3. Prevent my worksheet from saving the highlighted row after save.
4. Combine both the blinking cell and row highlighting into the sam
worksheet.


Is it correct to assume that the blinking cell and row highligh
programs cannot work if the worksheet is protected?

Thanks in advance to anyone who can figure all of the above out! (
know it’s quite a lot).

F

--
FloggingDolphinPosted from http://www.pcreview.co.uk/ newsgroup acces

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
Blinking Cell (Worksheet restarts) FloggingDolphin Excel Programming 0 June 28th 05 03:13 PM
Blinking Cell (Worksheet restarts) bhawane Excel Programming 0 June 27th 05 01:11 PM
Blinking Cell (Worksheet restarts) FloggingDolphin Excel Programming 0 June 24th 05 06:38 PM
Interactive Worksheet Interactive worksheet Excel Discussion (Misc queries) 5 May 17th 05 02:41 PM
Interactive worksheet Interactivity Excel Programming 2 May 17th 05 02:58 AM


All times are GMT +1. The time now is 10:41 PM.

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"