Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i have a cell number increase by 1 each time file opened | Excel Discussion (Misc queries) | |||
excel file opened automaticaly at specified time & date | Excel Discussion (Misc queries) | |||
Start at sprcific sheet every time opened | Excel Discussion (Misc queries) | |||
Enable check box in protected sheet + group check boxes | Excel Discussion (Misc queries) | |||
Make sequential numbers each time sheet is opened | Excel Worksheet Functions |