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: 586
Default Subscript out of Range

I am getting an error on Set removeRef line. The error state Subscript out
of Range, why is this?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Cancel = True
On Error GoTo LineExit 'if Quote sheet is blank it ignores error
Target = ActiveCell
On Error GoTo 0

Dim myRef As Range
Dim removeRef As Range
Dim LastRow As Long
Dim FirstRow As Long
Dim SelectRow As Long


'procedure if "Remove" is double clicked
If Target.Value = "Remove" Then
Response = MsgBox("Are you sure you want to remove " &
Target.Offset(-3).Text & " from the quote sheet?", vbOKCancel, "Remove
Product")
If Response < vbOK Then Exit Sub

Application.ScreenUpdating = False

Select Case Left(Target.Value, 2)
Case Is = "PF"
sh = "Plastic Faces"
Case Is = "EC"
sh = "Extruded Cabinets"
End Select

'finds reference number that is above the "Remove" that was clicked
Set removeRef =
Sheets(sh).Rows(1).Find(What:=Target.Offset(-3).Value, _
After:=Cells(1), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

'clears the particular product data that is stored in the plastic faces
worksheet
Sheets("QUOTE").Unprotect Password:="AdTech"
Sheets(sh).Unprotect Password:="AdTech"

'MY CODE CONTINUES...................

Thanks,
Ryan
 
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
9: Subscript out of range jenz21985 Excel Discussion (Misc queries) 6 May 5th 06 03:36 PM
Subscript out of Range Jon[_22_] Excel Programming 4 April 6th 06 11:24 PM
Subscript out of range Bruce001[_6_] Excel Programming 2 December 2nd 05 04:21 PM
Subscript out of range teresa Excel Programming 1 December 14th 04 09:56 PM
Subscript out of range Ed Excel Programming 1 February 5th 04 07:17 PM


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