Results 1 to 2 of 2

Thread: Sorting on objexcel in VB6

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Germany
    Posts
    2

    Post

    Lo all, only just found this site using altavista.

    Basically i am writing a program which will show football league tables using text boxes, and an OLE from Excel which has the basic details of the teams points etc.

    I have been able to do that fine however I can't seem to be able to think of the code or find the code which will be able to sort the records within the objExcel.

    So what I am trying to get to happen is that when you click on a command (in this case cmdShowNew) it will sort the records within my excel OLE and put them in alphabetical order. The field which I want to sort is the first field and starts from record 2 i.e the field has a title in this case TEAMS, and i want to sort the records which start in A2 to A7 (I've got 6 teams within my league)

    If any1 could help that would be extremely grateful.

  2. #2
    Guest
    Gudday Joe,

    Ok it would appear that you have sorted getting an excel object through vb. To sort on a field, don't have vb in front of me to look up the code , open the excel spreadsheet and start a marco recording, do your normal actions to sort by column, then stop the macro recording, (will ask for a name). Then simply look through the vba code produced. VB will be able to replicate this through the excel object properties, just code it in a routine.

    This is how l am learning to manipulate excel. If any problems email me at [email protected] and l will do it on one of the office machines and send ya the code.

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