Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > vb in excel


Reply
 
Thread Tools Display Modes
  #1  
Old 02-29-2004, 01:21 PM
dougvcd dougvcd is offline
Centurion
 
Join Date: Feb 2004
Location: Devon UK
Posts: 131
Default vb in excel


i have written a small prog that works ok in excelvb
can it be converted to run from standalone vb
i presume it would run better i dont know i am newbie
but what the prog does
lets you select data from sheet 1 and puts it in sheet 2
but to achive this you
have to open excel put on sheet 1
then open the vbeditor and run
then close editor
and then ope sheet 2
to see results
like i say works
but is there a better way

i will atach prog if anyone wants to look and see
cheers
Attached Files
File Type: zip database.zip (1.03 MB, 8 views)
Reply With Quote
  #2  
Old 02-29-2004, 01:54 PM
mark007's Avatar
mark007 mark007 is offline
Licensed to post

* Expert *
 
Join Date: Jul 2003
Location: York, Uk
Posts: 1,637
Default

It won't really run better in VB as a separate Vb app would have to automate Excel from a different process which would be slower.

However you could compile to COM in VB. This would be marginally quicker. For what you are doing there is no need for this though. the main issue appears to be having to go to the VBE. This is not necessary. Instaed go to tools/macro/macros.. it will have a little triangle play symbol next to it. Select the macro from the list and click play.

To improve this further goto:

customise/toolbars

add a macro button to one of your toolbars (or create a new one altogether if you want!). Then right click on it and select 'assign macro'. Select your macro and close the customise window.

The macro will then run on clicking this button.

Reply With Quote
  #3  
Old 02-29-2004, 01:56 PM
italkid's Avatar
italkid italkid is offline
Down...

Retired Moderator
* Expert *
 
Join Date: Dec 2002
Location: Belgium.
Posts: 6,731
Default

Or put a command button on the sheet...
Reply With Quote
  #4  
Old 03-01-2004, 02:35 AM
dougvcd dougvcd is offline
Centurion
 
Join Date: Feb 2004
Location: Devon UK
Posts: 131
Default new question

at the moment when the prog starts it reads data from excel sheet1
would it be poss to have an input box which then puts the data into list box and the copies to sheet2
just thought it might be easier for my son to use if instead of looking for 1 number in the list if he put the number in then excel finds it
many thanks
ps
thanks for all the help so far from you all
Doug uk

Last edited by dougvcd; 03-01-2004 at 05:59 AM.
Reply With Quote
  #5  
Old 03-01-2004, 11:27 AM
italkid's Avatar
italkid italkid is offline
Down...

Retired Moderator
* Expert *
 
Join Date: Dec 2002
Location: Belgium.
Posts: 6,731
Default

As Mark007 mentioned there is really no need to make it that complicated
for what you want to do.
Quote:
would it be poss to have an input box which then puts the data into list box and the copies to sheet2
Why this longwinded workeround ?
Use the listbox as it is now or you could insert an extra column in sheet1
in which you could enter for instance an "x" to select DaBird,and when
you have selected all the birds you want push a button to copy the
data of the selected birds...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating Excel from VB 6.0 Mike Rosenblum Tutors' Corner 7 04-10-2009 07:25 AM
Printing an Excel sheet from a VB form iceman Excel 1 08-11-2003 01:45 PM
copy Excel row to VB app fizbim Excel 3 05-27-2003 10:19 AM
VB link to Excel and back to VB ELV Word, PowerPoint, Outlook, and Other Office Products 36 08-22-2002 05:11 PM
QB to VB Conversion - By AIO BillSoo Tutors' Corner 0 08-06-2002 11:37 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->