Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Array Function

Status
Not open for further replies.

Bass71

MIS
Jun 21, 2001
79
I am looking for a function that evaluates similar values in a row of a spreadsheet, then groups them together and cuts those rows specifed:
Instead of going row by row, is there a function that will sweep through and evalutate all rows and then parse out the different values?

While ActiveCell(2, -1).Value <> &quot;&quot;

If ActiveCell(2, 1).Value = ActiveCell.Value Then
ActiveCell.Cut
End If

Wend

................Thanks for your help.........................RO
 
hello, in my opinion, it may be best to use a speadsheet for the controls on the program that will be needed to do the job.

have a Row number and a column number in the extra spread sheet to indicate the row count and the column count if the speadsheet grows.

then refence the fields and create a 2 dim for loop.
I think that is what you were planning to do, but I just wanted to reiterate that it is a good Idea.

Michael vick
 
Is this Access or Excel???

If Access, use its query power to help you
Forget Arrays

It goes like this
Dim db As Database, rst As Recordset, SQL As String
Set db = CurrentDb
SQL = &quot;Select * From YourTable Where something = &quot; & yourvalue
Set rst = db.OpenRecordset(SQL)
rst.MoveLast
Debug.Print &quot;Number of matches = &quot; & rst.RecordCount
' then you can do a myriad of other things
rst.Close
db.Close

If it matches then you get all of the matches in a split second
No Looping either.
Its called returning a recordset and Access was born to do it and do it FAST.
I stopped using any arrays a while ago.


DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top