Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Code in certain sheets
Hello
I have a file with 33 sheets and a VB code (below) in "This Workbook". The problem is that I don't want the first and last sheets obey this code. How can I fix this problem? This is code: Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Not Application.Intersect(Target, Range("A7:A68")) Is Nothing Then If IsNumeric(Target.Value) Then Application.EnableEvents = False Target = Left(Format(Target.Value, "0000"), 2) & ":" & _ Right(Format(Target.Value, "0000"), 2) Application.EnableEvents = True End If End If If Not Application.Intersect(Target, Range("G7:G64")) Is Nothing Then If IsNumeric(Target.Value) Then Application.EnableEvents = False Target = Left(Format(Target.Value, "0000"), 0) & "P." & _ Right(Format(Target.Value, "0000"), 2) Application.EnableEvents = True End If End If End Sub Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sum across range of sheets for a cost code | Excel Worksheet Functions | |||
Code to hide sheets | Excel Worksheet Functions | |||
VBA Code to Add the same header from my first sheet into 20 sheets | Excel Worksheet Functions | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Worksheet Functions | |||
Formating Sheets made in Code | Excel Discussion (Misc queries) |