LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 3
Default Run-time error '424': Object required

The code below allows me highlight one row at a time. I can scroll up and down a sheet using the arrow keys.
Sometimes need to highlight two or more rows by holding shift and clicking multiple rows. The code is only allowing me to highlight one row at a time however I can select multiple rows.

When I try to preform a delete command on multiple rows I have selected I am receiving an this error code after the delete is preformed and I then select another row to highlight:
Run-time error '424': Object required

When I click DEBUG it highlights this row in the code:
For Each Dn In rng


Option Explicit
Dim rng As Range, ray
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Dn As Range, c As Long, col As Long
col = 100
If Not rng Is Nothing Then
c = 0
For Each Dn In rng
c = c + 1
Dn.Interior.ColorIndex = ray(c, 1)
Next Dn
End If
c = 0
Set rng = Cells(Target.Row, 1).Resize(, col)
ReDim ray(1 To rng.Count, 1 To 2)
For Each Dn In rng
c = c + 1
ray(c, 1) = Dn.Interior.ColorIndex
Next Dn
Cells(Target.Row, 1).Resize(, col).Interior.ColorIndex = 6
End Sub
 
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
Object required Run-time error '424' Ayo Excel Programming 4 August 25th 09 05:36 PM
Run-time error '424': Object Required Doug Excel Programming 2 May 27th 09 11:56 PM
Run Time error 424 Object Required Casey[_70_] Excel Programming 8 April 12th 06 07:51 PM
Object required - run time error 424. devorivivere Excel Programming 3 April 10th 04 05:43 PM
Run-time error '424': Object required Phil Bewig Excel Programming 3 February 1st 04 08:38 PM


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