Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating timed alert for empty cell


Sathisc;337322 Wrote:
Hi Simon,

I am a beginner in Excel. Can you breif more on the ontime method.

Cheers,
SathishResearch the OnTime method, there's lots of info out there, however

follow these instructions and you should be good to go:
Paste this code in the worksheet code module that you are working with

*How to Save a Worksheet Event Macro*
1. *Copy* the macro using *CTRL+C* keys.
2. Open your Workbook and *Right Click* on the *Worksheet's Name Tab*
for the Worksheet the macro will run on.
3. *Left Click* on *View Code* in the pop up menu.
4. *Paste* the macro code using *CTRL+V*
5. Make any custom changes to the macro if needed at this time.
6. *Save* the macro in your Workbook using *CTRL+S*


Code:
--------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r2 As String
r2 = Range("IV" & Range(MyRange).Row).End(xlToLeft).Address
If Range(MyRange) < "" Then
Range(MyRange & ":" & r2).Interior.ColorIndex = xlNone
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MyRange = Target.Address
If Target = "" Then GoTo Nxt
If Target < "" Then
Range(MyRange & ":" & Range("IV" & Range(MyRange).Row).End(xlToLeft).Address).Interio r.ColorIndex = xlNone
End If
Exit Sub
Nxt:
'in this timeserial 0 = hrs, 0 = minutes, 0 = seconds it is set for 10 seconds at the moment
Application.OnTime (Now + TimeSerial(0, 0, 10)), "ColourRow"
Exit Sub
End Sub
--------------------
Next paste this in a standard code module:

*How to add and run a Macro*1. *Copy* the macro below pressing
the keys *CTRL+C*
2. Open your workbook
3. Press the keys *ALT+F11* to open the Visual Basic Editor
4. Press the keys *ALT+I* to activate the *Insert menu*
5. *Press M* to insert a *Standard Module*
6. *Paste* the code by pressing the keys *CTRL+V*
7. Make any custom changes to the macro if needed at this time.
8. *Save the Macro* by pressing the keys *CTRL+S*
9. Press the keys *ALT+Q* to exit the Editor, and return to Excel.

*To Run the Macro...*
To run the macro from Excel, open the workbook, and press *ALT+F8* to
display the *Run Macro Dialog*. Double Click the macro's name to *Run*
it.



Code:
--------------------
Public MyRange As String
Sub ColourRow()
Range(Activecell.Address & ":" & Range("IV" & Activecell.Row).End(xlToLeft).Address) _
.Interior.ColorIndex = 3
End Sub

--------------------
The code should now do what you want, although i have set it to 10
seconds so you can see it working!


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=94274

 
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
alert Brian Excel Discussion (Misc queries) 0 December 21st 06 06:52 PM
How to Create Sound Alert and Email Alert when Macro is Finish Tom Ogilvy Excel Programming 0 November 30th 06 11:12 PM
How to Create Sound Alert and Email Alert when Macro is Finish Bob Phillips Excel Programming 0 November 30th 06 09:21 PM
How to Create Sound Alert and Email Alert when Macro is Finished Bob Davison Excel Programming 0 November 30th 06 08:14 PM
Pop-up Alert Help Thomas Excel Programming 2 September 20th 05 01:27 AM


All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"