Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default processing part of a collection

hello,

This is the next step in the last code i posted. I looks at a rang
and makes the cell values items in a colection. THen thing i can'
seem to do now is process the items.

each item is test to see if it has a length less than four if it doe
than its supposed to add "0" to the front the item until it has
length of four.

the problem occurs when it get to a line that reads:

COL1.Item(I) = 0 & COL1.Item(I)

it gives me a runtime error highlighting that line and says objec
required.

I can't think of an object to put in there


here is the whole code:


Sub collection()

Dim COL1 As New collection
Dim REPL As Variant
Dim FRST As Variant
Dim SCND As Single

Range("c2:F2").Select
For Each cell In Selection
COL1.Add (cell.Value)
Next cell

For I = 1 To 4
If Len(COL1.Item(I)) < 4 Then
Do Until Len(REPL) = 4
COL1.Item(I) = 0 & Item.COL1(I)
Loop

End If
Next

FRST = COL1(1) & COL1(2) & COL1(3) & COL1(4)
SCND = Len(FRST)

MsgBox (SCND)
MsgBox (FRST)

End Sub


can you process items in a collection idividuall

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

Reply
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
Processing Time [email protected] Excel Worksheet Functions 0 July 20th 07 06:52 PM
excel processing Wendy Elizabeth Excel Worksheet Functions 1 June 18th 07 05:17 PM
Processing Data dan Excel Worksheet Functions 0 August 13th 06 02:33 AM
data processing Youyou Excel Discussion (Misc queries) 1 November 19th 05 10:42 AM
Conditional Processing Daniell Excel Discussion (Misc queries) 3 August 26th 05 12:45 AM


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