Click to See Complete Forum and Search --> : VB in MS Excel


Sander Hunter
August 31st, 2001, 01:14 PM
Hi there,

I am new with VB, but have program experience. Now I need to do some VB programming in Excel.

I need to place all the cell's from 1 column, with the same value together. Then I need to sort the values of the second column from one value group from the first column.

So I know what I need to do, but I do not know the commands:
1. Sort the first column (can do)
2. Select the first same values in the 1st column (this is the mature problem, because I do not know how to retreive a value of a Cell in Excel)
3. Sort the selctions 2nd column (can do).
4. Select the 2nd same values in the 1st column
5. and so on.

So what I realy need to know is: How can I retreive the value of an Excel Cell (with a variable index).

Thanks,
Sander

DSJ
August 31st, 2001, 01:23 PM
This example really doesn't address your problem in anyway, but may give you an idea how to get the cells you need, etc.

[vbcode/
Sub Test()
Dim Total As Integer

For i = 1 To 6
Total = Total + Sheet1.Cells(i, 1).Value
Next

MsgBox Total

End Sub
[/vbcode]