LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
moglione1
 
Posts: n/a
Default Subscript out of range error


I have been handed a VBA project which contains the following code (See
end). When I run the project I get the following error.

Encoutered a problem. Please ensure the column name has not been
amended. If the problem persists please report to administrator.


ErrorDes: Subscript out of range ErrorID:9 ErrorSource: VBAProject

*Can anybody please clarify why I am getting this error and how I
should resolve it. *


Dim sheeP As String

sheeP = ActiveSheet.Name

Dim dic1 As Object, x1, r1 As Range
Dim dic2 As Object, x2, r2 As Range
Dim p, q, s, fnlNumb As Variant
Set dic1 = CreateObject("Scripting.Dictionary")
Set dic2 = CreateObject("Scripting.Dictionary")

With Cells
Set c = .Find("Sell-to", LookIn:=xlValues, LookAt:=xlPart)
If Not c Is Nothing Then
firstAddress = c.AddressLocal
Do
add1 = c.AddressLocal

With Sheets(sheeP)
For Each r1 In .Range(add1)

p = Split(r1, " ")
q = Split(p(2), "(")
s = Split(q(1), ")")
fnlNumb = s(0)

If Not IsEmpty(r1) And Not dic1.exists(p(3) & " " & p(4) & " "
& fnlNumb) Then

dic1.Add p(3) & " " & p(4) & " " & fnlNumb, fnlNumb

End If
Next
End With

Set c = .FindNext(c)

Loop While Not c Is Nothing And c.AddressLocal < firstAddress

End If
End With


--
moglione1
------------------------------------------------------------------------
moglione1's Profile: http://www.excelforum.com/member.php...o&userid=26414
View this thread: http://www.excelforum.com/showthread...hreadid=400374

 
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
VBA code error with Protection turned on - help please Fred Excel Discussion (Misc queries) 1 March 17th 06 04:06 PM
Subscript out of range ... sometimes! (Same code unpredictable re Dennis Excel Discussion (Misc queries) 3 August 11th 05 02:58 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
Changing a range of an array in a SUMPRODUCT formula gives a #N/A error Chrism Excel Discussion (Misc queries) 4 May 4th 05 04:06 PM
Validation error: Says range not found and it is there? JMike Excel Discussion (Misc queries) 1 February 11th 05 06:35 PM


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