Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default The code below worked for a few days and just totally stoppedworking.

The code below worked for a few days and just totally stopped
working.
What can I do to make sure it continues to work? Thanks!

-----


Private Sub Worksheet_Change(ByVal Target As Range)
Dim C As Range, D As Range
Set D = Intersect(Range("A:A"), Target)
If D Is Nothing Then Exit Sub
For Each C In D


On Error Resume Next
Target.Offset(0, 6).FormulaR1C1 = "=RC[-2]&RC[-5]" ' - For Column E
Target.Offset(0, 7).FormulaR1C1 = "=RC[-2]&RC[-5]" ' - For Column F
Target.Offset(0, 9).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC7,I.O.!
R2C1:R5708C5,4,FALSE))=TRUE,0,VLOOKUP(RC7,I.O.!
R2C1:R5708C5,4,FALSE))"
' - For Column J
Target.Offset(0, 10).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC8,'Mellon
Download'!R2C1:R4573C3,2,FALSE))=TRUE,0,VLOOKUP(RC 8,'Mellon
Download'!
R2C1:R4573C3,2,FALSE))" ' - For Column K
Target.Offset(0, 11).FormulaR1C1 = "=RC[-2]-RC[-1]" ' - For Column L
Target.Offset(0, 12).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC7,I.O.!
R2C1:R5392C5,5,FALSE))=TRUE,0,VLOOKUP(RC7,I.O.!
R2C1:R5392C5,5,FALSE))-
IF(ISNA(VLOOKUP(RC8,'Mellon Download'!R2C1:R4573C3,3,FALSE))=TRUE,
0,VLOOKUP(RC8,'Mellon Download'!R2C1:R4573C3,3,FALSE))" ' - For
Column
M
Target.Offset(0, 13).Value = "1" ' - For Column N
Target.Offset(0, 14).FormulaR1C1 = "=RC[-2]*RC[-1]" ' - For Column O
Target.Offset(0, 15).FormulaR1C1 = "=TODAY()" ' - For Column p
Target.Offset(0, 16).FormulaR1C1 = "=IF(RC[-1]="""","""",TODAY()-RC
[-1])" ' - For Column Q


Next C


End Sub


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default The code below worked for a few days and just totally stopped working.

Try running this or leave Excel and come back

sub fixit()
application.enableevents=true
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Damil4real" wrote in message
...
The code below worked for a few days and just totally stopped
working.
What can I do to make sure it continues to work? Thanks!

-----


Private Sub Worksheet_Change(ByVal Target As Range)
Dim C As Range, D As Range
Set D = Intersect(Range("A:A"), Target)
If D Is Nothing Then Exit Sub
For Each C In D


On Error Resume Next
Target.Offset(0, 6).FormulaR1C1 = "=RC[-2]&RC[-5]" ' - For Column E
Target.Offset(0, 7).FormulaR1C1 = "=RC[-2]&RC[-5]" ' - For Column F
Target.Offset(0, 9).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC7,I.O.!
R2C1:R5708C5,4,FALSE))=TRUE,0,VLOOKUP(RC7,I.O.!
R2C1:R5708C5,4,FALSE))"
' - For Column J
Target.Offset(0, 10).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC8,'Mellon
Download'!R2C1:R4573C3,2,FALSE))=TRUE,0,VLOOKUP(RC 8,'Mellon
Download'!
R2C1:R4573C3,2,FALSE))" ' - For Column K
Target.Offset(0, 11).FormulaR1C1 = "=RC[-2]-RC[-1]" ' - For Column L
Target.Offset(0, 12).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC7,I.O.!
R2C1:R5392C5,5,FALSE))=TRUE,0,VLOOKUP(RC7,I.O.!
R2C1:R5392C5,5,FALSE))-
IF(ISNA(VLOOKUP(RC8,'Mellon Download'!R2C1:R4573C3,3,FALSE))=TRUE,
0,VLOOKUP(RC8,'Mellon Download'!R2C1:R4573C3,3,FALSE))" ' - For
Column
M
Target.Offset(0, 13).Value = "1" ' - For Column N
Target.Offset(0, 14).FormulaR1C1 = "=RC[-2]*RC[-1]" ' - For Column O
Target.Offset(0, 15).FormulaR1C1 = "=TODAY()" ' - For Column p
Target.Offset(0, 16).FormulaR1C1 = "=IF(RC[-1]="""","""",TODAY()-RC
[-1])" ' - For Column Q


Next C


End Sub



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
Total days worked /20 to get actual months/days Cindy Excel Worksheet Functions 3 October 22nd 09 11:50 PM
Employee days worked (-Holidays, -weekends, Snow Days, etc) Denise Excel Discussion (Misc queries) 2 December 31st 08 04:37 PM
FORMULA, DAYS WORKED TO VACATION DAYS John5835 Excel Worksheet Functions 2 July 31st 08 09:28 PM
Calcaulate # of days worked richzip Excel Discussion (Misc queries) 2 March 6th 08 06:25 AM
Counting # of days worked Curtis Excel Worksheet Functions 8 November 18th 06 05:14 PM


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

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"