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: 1
Default Do I need a two dimensional array for this?

This code stores a value for each number (which is a location) tha
starts with ICE. That prevents PACK fron using the same location numbe
later in the code. I now have a third category "QA". I can't figure ou
how to stop PACK from using the same location numbers as QA. Any hel
greatly appreciated

i = 125
For Each Row In Rows("10:325")
cnt = 0
For Each CELL In Row.Columns("K:DB")
If CELL.Value = "QAPK" Then
CELL.Value = "QA" & CStr(i)
cnt = cnt + 1
End If
Next CELL
If cnt 0 Then
i = i + 2
If i 135 Then i = 125
End If
Next Row

i = 100
For Each Row In Rows("10:325")
cnt = 0
For Each CELL In Row.Columns("K:DB")
If CELL.Value = "ICE" Then
ReDim Preserve arr(UBound(arr) + 1)
arr(UBound(arr)) = i
CELL.Value = "IC" & CStr(i)
cnt = cnt + 1
End If
Next CELL
If cnt 0 Then
i = i + 2
If i 144 Then i = 100
End If
Next Row

i = 100
For Each Row In Rows("10:325")
cnt = 0
For Each CELL In Row.Columns("K:DB")
If CELL.Value = "PACK" Then
ReDim Preserve arr(UBound(arr) + 1)
arr(UBound(arr)) = i
found = 0
On Error Resume Next
found = WorksheetFunction.Match(i, arr, 0)
If found Then i = i + 1
CELL.Value = "PK" & CStr(i)
cnt = cnt + 1
End If
Next CELL
If cnt 0 Then
i = i + 1

If i = 146 Then i = 100
End If
Next Ro

--
Message posted from http://www.ExcelForum.com

 
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
Lookup within a 2 dimensional array Edu Excel Worksheet Functions 5 March 31st 10 09:52 PM
Three Dimensional Array Question Tornados Excel Discussion (Misc queries) 1 June 20th 05 12:58 AM
add to two dimensional array GUS Excel Programming 1 August 26th 03 12:12 AM
2 Dimensional Array Tom Ogilvy Excel Programming 0 August 18th 03 08:04 PM
2 Dimensional Array steve Excel Programming 0 August 18th 03 07:19 PM


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