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 ReDim to store values so they are not used again

This code works well, as it fills the rows with the appropriate valu
based on what is in the cell. The redim stores the number used by IC
and prevents it from being used by PACK. I have 45 distinct location
so I can not use a location Csrt(i) twice.

I need to add a new task to the mix "QA" QA can only be placed in
locations 127-129-131-133 I need to add this to the bottom of the cod
and restrict it from using a location that was already used. Any ideas
It is alittle over my head.

Thanks

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
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 Row
:confused

--
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
How to Periodically Store/Save Excel DDE Values ** Excel Discussion (Misc queries) 1 August 10th 07 09:17 PM
Need to store changing values from one cell Emmie Excel Discussion (Misc queries) 5 September 17th 06 08:10 PM
Store values of a dynamically changing cell Yogesh Excel Worksheet Functions 0 August 4th 05 06:40 PM
read the values in a range and store them in macro Tom Ogilvy Excel Programming 0 September 13th 03 11:05 PM
update and store new high values jack[_5_] Excel Programming 0 July 10th 03 01:22 AM


All times are GMT +1. The time now is 06:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"