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: 142
Default Worksheet_Change

Why can't I use this:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Range("Data").Rows.Count < Sheet6.Cells(1, 199).Value Then
Dim x
x = Target.Row

Sheet6.Cells(1, 200).Value = Sheet6.Cells(1, 200).Value & " / " & x
Sheet6.Select

Cells(x, 1).Select' <== This line causes
' a "Select Method of Range Class Failed" error

Selection.EntireRow.Delete

End If
Sheet6.Cells(1, 199).Value = Range("Data").Rows.Count
End Sub

What I'm doing is looking at the sheet that the event is fired from,
getting the target range, determining if a row was deleted, then I
want to go to sheet6 and delete the corresponding row. When
debugging, x = the row that I deleted, but I can't seem to select the
same row on the other sheet...

 
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_Change [email protected] Excel Programming 2 November 22nd 04 12:17 AM
Worksheet_Change Job[_2_] Excel Programming 1 August 13th 03 03:23 AM
worksheet_change vs. calculate, and worksheet_change not running Tom Ogilvy Excel Programming 1 July 14th 03 02:51 AM
worksheet_change vs. calculate, and worksheet_change not running Ross[_5_] Excel Programming 0 July 13th 03 04:27 PM


All times are GMT +1. The time now is 04:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"