CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: VB in MS Excel

  1. #1
    Join Date
    Jul 2000
    Location
    Netherlands
    Posts
    57

    VB in MS Excel

    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


  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: VB in MS Excel

    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]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured