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: 5
Default Range Find got Subscript out of range

below code works on Window 2000/Excel2000, but when upgrade to XP/Excel
2003 it failed with Subscript out of range: Please help. Thanks.

Codes first read workbook sheet(2), get the data, then try to find summary
sheet(1) with the same mfg header's column index, then back to sheet(2) keep
processing

For licnt = 1 To UBound(orsMfg_Name)
oricolindex = 1
oriRowIndex = oriRowIndex + 1
objSheet(lisheetno).Range("A" & oriRowIndex) =
orsMfg_Name(licnt).tName

'search to see which column on summary sheet for this mfg
Set oriSearch = objSheet(1).Range("A10:IV11").Find(orsMfg_Name
(licnt).tName, LookIn:=xlValue) --- Abend here on subscript out of
range

If Not oriSearch Is Nothing Then
lisumcol = oriSearch.Column
Set oriSearch = Nothing
End If

oricolindex = oricolindex + 7
Do While oricolindex <= oriTotalCols
objSheet(lisheetno).Range(frfColName(oricolindex) &
oriRowIndex).Formula = "=SUMIF($G$" _
& orirowstart & ":$G$" & orirowend & "," & """" & "=" &
orsMfg_Name(licnt).tName _
& """" & "," & frfColName(oricolindex) & orirowstart _
& ":" & frfColName(oricolindex) & orirowend & ")"
objSheet(lisheetno).Range(frfColName(oricolindex) &
oriRowIndex).NumberFormat = "##,##0_);[Red](##,##0)"
oricolindex = oricolindex + 1
Loop

objSheet(1).Range(frfColName(lisumcol) & orisumrow +
lisheetno).Formula = "=+" & Chr(39) & objSheet(lisheetno).Name & Chr(39) &
"!" & frfColName(oriTotalCols) & oriRowIndex
objSheet(1).Range(frfColName(lisumcol) & orisumrow +
lisheetno).NumberFormat = "##,##0_);[Red](##,##0)"

Next licnt
 
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
Subscript out of range Bruce001[_6_] Excel Programming 2 December 2nd 05 04:21 PM
Subscript out of range.... Edgar Thoemmes[_4_] Excel Programming 4 January 13th 05 02:06 AM
subscript out of range Todd Huttenstine[_3_] Excel Programming 1 June 11th 04 04:08 AM
Subscript out of range? Jason Hancock Excel Programming 3 May 26th 04 07:11 PM
Subscript out of Range on Range reference Tom Ogilvy Excel Programming 0 September 13th 03 03:38 PM


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