Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default 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

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
Worksheet Chnage....still need help please Brettjg Excel Programming 4 April 9th 09 12:44 PM
chnage from average to sum(or count) Jim Excel Discussion (Misc queries) 3 January 9th 09 07:19 PM
chnage pronounsaction in speech recongnition santosh Excel Programming 0 March 17th 08 06:58 AM
Event Procedures: Event on Worksheet to fire Event on another Worksheet Kathryn Excel Programming 2 April 7th 04 07:35 PM


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