 |
| VB How-To Ask your "How do I do this with VB?" questions in this forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 19th, 2003, 01:25 PM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Manipulating Excel spreadsheet in Visual Basic
Hello,
I am currently do a project at university on Visual Basic, where I update a spreadsheet with some values and it does some fancy stuff. However, I can't manage the last little bit. I need to show the spreadsheet in alphabetical order of a column full of names.
is there a sort method i could use or something?
Thanks in advance
Mark MacInnes
|
|

November 19th, 2003, 01:33 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
hi there..
what type of spreadsheet are you using??
where do you get the data from??
HTH...
Gonzalo Bianchi
|
|

November 19th, 2003, 01:35 PM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am using an excel 2000 spreadsheet (it's called basic_league.xls if that helps). I am using an OLE control to put the spreadsheet in my form. This is code to open it:
Set objExcel = GetObject(OLE_LeagueTable.SourceDoc)
|
|

November 19th, 2003, 01:45 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
ok.. i never use excel inside vb, but can you just run the procedure you want as a macro in excel, and then copy the code that it writes so you can pass it to the excel object??
did i xplain rigth???
HTH...
Gonzalo Bianchi
|
|

November 19th, 2003, 01:48 PM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
a macro would write it in VBA?
we've been told to not use VBA.
________________________
I am still learning
|
|

November 19th, 2003, 01:51 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
dont use vba.. just see how it do it.. and then do the same via vb6..
HTH...
Gonzalo Bianchi
|
|

November 19th, 2003, 01:54 PM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
oh right. cheers. i'll have a go at that!!!
________________________
I am still learning
|
|

November 19th, 2003, 03:51 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Check out http://www.greggriffiths.org/webdev/both/excel/ while aimed at Classic ASP, the code and basics presented should be of assistance.
|
|

November 20th, 2003, 11:36 AM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
just in case anyone is interested, i have found a solution.
i have been working at the code with a friend on my project, and we have got it working. basically, we use the bubble sort thing and compared each value in the spreadsheet to the one below to see if it was higher or lower in alphabetical order and swapped them when needed.
we are going to try to use arrays to do this now, as arrays would hopefully be quicker.
________________________
I am still learning
|
|
 |