Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
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
 
Old November 19th, 2003, 01:25 PM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to dreaming
Default 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
 
Old November 19th, 2003, 01:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

what type of spreadsheet are you using??

where do you get the data from??

HTH...

Gonzalo Bianchi
 
Old November 19th, 2003, 01:35 PM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to dreaming
Default

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)
 
Old November 19th, 2003, 01:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

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
 
Old November 19th, 2003, 01:48 PM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to dreaming
Default

a macro would write it in VBA?
we've been told to not use VBA.

________________________
I am still learning
 
Old November 19th, 2003, 01:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

dont use vba.. just see how it do it.. and then do the same via vb6..

HTH...

Gonzalo Bianchi
 
Old November 19th, 2003, 01:54 PM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to dreaming
Default

oh right. cheers. i'll have a go at that!!!

________________________
I am still learning
 
Old November 19th, 2003, 03:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

Check out http://www.greggriffiths.org/webdev/both/excel/ while aimed at Classic ASP, the code and basics presented should be of assistance.
 
Old November 20th, 2003, 11:36 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to dreaming
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP in Visual Studio 2005 Pro (Visual Basic) shoopes VB How-To 1 June 29th, 2006 02:08 PM
Using Visual Basic behind Excel Control Buttons Danielle Beginning VB 6 0 January 10th, 2006 06:32 AM
Visual basic excel application momowu0701 Beginning VB 6 1 December 15th, 2005 01:44 PM
visual basic in excel help me pakmaniac Access VBA 2 January 2nd, 2004 10:55 AM
Excel-Visual basic kasimg Excel VBA 1 August 9th, 2003 03:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.