LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Error when Target Range is block, not cell in Worksheet_Change Eve

I have the following code in the Worksheet_Change event procedure.
I want to mark each row in the target range as changed if any cell in the
row has been changed (Column 20).
It works fine when the target is a single cell. If a block of cells is
pasted into the sheet, I get a 1004 error on trying to set the change flag in
col 20.

Application.EnableEvents=False
For each cel in Target.cells
Set rngTgt = cel.EntireRow.Cells(1, 1)
rngTgt.offset(0,20).value = 1 'Gets 1004 error
next cel

InTHANKSadvance
Jim

 
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
REPSOT?? Sub Worksheet_Change(ByVal Target As Range) Ed Davis[_2_] Excel Discussion (Misc queries) 14 October 13th 09 03:20 PM
Prevent error when deleting row within Worksheet_Change target ran Peter Rooney Excel Programming 0 February 1st 06 03:41 PM
Private Sub Worksheet_Change(ByVal Target As Range) Arturo Excel Programming 1 May 25th 05 03:32 PM
Error with Target.Name.Name in Worksheet_Change event SuperJas Excel Programming 2 January 8th 04 03:26 AM
Many Sub Worksheet_Change(ByVal Target As Range) In One Worksheet MathewPBennett Excel Programming 4 December 24th 03 01:01 PM


All times are GMT +1. The time now is 02:12 AM.

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"