Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Don Don is offline
external usenet poster
 
Posts: 487
Default Check a sheet each time file opened?

I have the following in my sheet command.
--------------------------------------------------
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

If Cells(7, 7).Value = "Processed" Then
Range(Cells(6, 6), Cells(7, 7)).Select
Selection.ClearContents
End If
MsgBox "event happened", vbExclamation
End Sub
-------------------------------------------------
It is to remove what is in cell 6,6 through 7,7 if in cell 7,7 it has
"Processed". I have Excel 2002. It works when Excel is not open and you
open the file from Explore. How can I get it to check each time the file is
opened? Would checking every time the sheet is updated be too much and is
that possible? I have tried using the "Application.EnableEvents" but found
that I did not do it right and when I tested on office 2007 , it went into a
loop and locked Excel.

thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Check a sheet each time file opened?

You can put the code in Worksheet_Activate() so that it gets executed when
you activate the sheet...

Worksheet_Activate()
If Cells(7, 7).Value = "Processed" Then
Range(Cells(6, 6), Cells(7, 7)).Select
Selection.ClearContents
End If
MsgBox "event happened", vbExclamation
End Sub
"Don" wrote:

I have the following in my sheet command.
--------------------------------------------------
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

If Cells(7, 7).Value = "Processed" Then
Range(Cells(6, 6), Cells(7, 7)).Select
Selection.ClearContents
End If
MsgBox "event happened", vbExclamation
End Sub
-------------------------------------------------
It is to remove what is in cell 6,6 through 7,7 if in cell 7,7 it has
"Processed". I have Excel 2002. It works when Excel is not open and you
open the file from Explore. How can I get it to check each time the file is
opened? Would checking every time the sheet is updated be too much and is
that possible? I have tried using the "Application.EnableEvents" but found
that I did not do it right and when I tested on office 2007 , it went into a
loop and locked Excel.

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
how do i have a cell number increase by 1 each time file opened DJbase Excel Discussion (Misc queries) 1 May 25th 08 04:17 AM
excel file opened automaticaly at specified time & date aligaz Excel Discussion (Misc queries) 2 December 17th 07 04:45 PM
Start at sprcific sheet every time opened wx4usa Excel Discussion (Misc queries) 3 January 27th 07 02:20 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
Make sequential numbers each time sheet is opened Darrell Shuman Excel Worksheet Functions 1 October 19th 05 03:35 AM


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