![]() |
Worksheet chnage event
Hi,
I have the following triggered by a worksheet change (there's some other stuff before this line, but that's all working) which causes an error: Case Is = "Open" Range("a" & Target.Row & ":ac" & Target.Row).Select With Selection.Interior .ColorIndex = xlNone End With Range("o" & Target.Row & ":q," & Target.Row & "t" & Target.Row_ & ":v," & Target.Row & "z" & Target.Row & ":ab" & Target.Row).Select With Selection .Value = "" End With End Select The error is being generated at the line Range("o" & Target.Row & <etc etc) and is "Run-time error 1004: Method 'Range' of object '_Worksheet' failed Can someone please tell me what tis means and how I fix it? TIA Dave |
Worksheet chnage event
For some reason, if I substitute:
Range("O" & Target.Row & ":Q" & Target.Row & ",T" & Target.Row & ":V" &_ Target.Row & ",Z" & Target.Row & ":ab" & Target.Row).Value = "" This works. Happy to have fixed it but would appreciate an explanation Dave "Risky Dave" wrote: Hi, I have the following triggered by a worksheet change (there's some other stuff before this line, but that's all working) which causes an error: Case Is = "Open" Range("a" & Target.Row & ":ac" & Target.Row).Select With Selection.Interior .ColorIndex = xlNone End With Range("o" & Target.Row & ":q," & Target.Row & "t" & Target.Row_ & ":v," & Target.Row & "z" & Target.Row & ":ab" & Target.Row).Select With Selection .Value = "" End With End Select The error is being generated at the line Range("o" & Target.Row & <etc etc) and is "Run-time error 1004: Method 'Range' of object '_Worksheet' failed Can someone please tell me what tis means and how I fix it? TIA Dave |
Worksheet chnage event
The difference is not in the upper/lower case, but in where the commas are.
If your target.row was 12, the old range would have been o12:q,12t12:v,12z12:ab12 instead of the new one o12:q12,t12:v12,z12:ab12 -- Daryl S "Risky Dave" wrote: For some reason, if I substitute: Range("O" & Target.Row & ":Q" & Target.Row & ",T" & Target.Row & ":V" &_ Target.Row & ",Z" & Target.Row & ":ab" & Target.Row).Value = "" This works. Happy to have fixed it but would appreciate an explanation Dave "Risky Dave" wrote: Hi, I have the following triggered by a worksheet change (there's some other stuff before this line, but that's all working) which causes an error: Case Is = "Open" Range("a" & Target.Row & ":ac" & Target.Row).Select With Selection.Interior .ColorIndex = xlNone End With Range("o" & Target.Row & ":q," & Target.Row & "t" & Target.Row_ & ":v," & Target.Row & "z" & Target.Row & ":ab" & Target.Row).Select With Selection .Value = "" End With End Select The error is being generated at the line Range("o" & Target.Row & <etc etc) and is "Run-time error 1004: Method 'Range' of object '_Worksheet' failed Can someone please tell me what tis means and how I fix it? TIA Dave |
Worksheet chnage event
Of course!
Thanks "Daryl S" wrote: The difference is not in the upper/lower case, but in where the commas are. If your target.row was 12, the old range would have been o12:q,12t12:v,12z12:ab12 instead of the new one o12:q12,t12:v12,z12:ab12 -- Daryl S "Risky Dave" wrote: For some reason, if I substitute: Range("O" & Target.Row & ":Q" & Target.Row & ",T" & Target.Row & ":V" &_ Target.Row & ",Z" & Target.Row & ":ab" & Target.Row).Value = "" This works. Happy to have fixed it but would appreciate an explanation Dave "Risky Dave" wrote: Hi, I have the following triggered by a worksheet change (there's some other stuff before this line, but that's all working) which causes an error: Case Is = "Open" Range("a" & Target.Row & ":ac" & Target.Row).Select With Selection.Interior .ColorIndex = xlNone End With Range("o" & Target.Row & ":q," & Target.Row & "t" & Target.Row_ & ":v," & Target.Row & "z" & Target.Row & ":ab" & Target.Row).Select With Selection .Value = "" End With End Select The error is being generated at the line Range("o" & Target.Row & <etc etc) and is "Run-time error 1004: Method 'Range' of object '_Worksheet' failed Can someone please tell me what tis means and how I fix it? TIA Dave |
All times are GMT +1. The time now is 08:26 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com