p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 22nd, 2004, 06:15 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pratlina
Default Reading Values from Excel cell into VB 6 applicati

Hi,
I have an application that has cascading drop downs. So I have 3 drop downs: Program group, Program, & Department. When a user chooses a Program group, I show a different list of programs for that program gorup. And when a user chooses a Program, I show a different list of departments for that program. When a user chooses a department I attach a costcenter number to it in the background. My problem is that I have hard coded everything. When these program groups, programs, and departments change I have to rewrite the code from scratch. Here is a sample fo my current code:

If (Business_Group.Text = "Finance") Then

    If (Department.Text = "Payroll") Then
    ccn.AddItem ("71507600012001")
    ElseIf (Department.Text = "Human Resources") Then
    ccn.AddItem ("71510761214001")
    ElseIf (Department.Text = "Requisitions") Then
    ccn.AddItem ("71206000014001")

Above, I am attaching the cost center numbers. Is there a way for all the values to just simply read them form an excel spreadsheet? Please help!!!


Thanks,
Pratlina
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old December 27th, 2004, 08:58 PM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That can be accomplished. But first, do you have other data that your program needs to store? If so, maybe consider an *.ini,*.txt,*.mdb, files or even the registry... it all depends on what ya got and how ya wanna store it. Excel surely makes it accessible, visible and easily editable by the user if that's what ya want. Or you could implement a data entry form just for this. Just some thoughts for ya. Let me know and I'll help ya.
Later

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old December 28th, 2004, 08:28 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pratlina
Default

Hi ,
Thanks for your response. Having a data entry formn would be too much work as we are literally talking about thousands of cost centre numbers. I don't mind using the .txt file but we get the values in Excel form so we would have to format it which is what I am trying to avoid. The best solutions would be the ability to say for program values read column A in this Excel file and then based on progam read column B from this cell to this cell etc etc. Any ideas?

Thanks,
Pratlina

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
data reading from excel using VB.net fly2irfan VB Databases Basics 1 January 27th, 2008 02:35 AM
c# and Excel cell values hardboiled C# 0 November 16th, 2007 11:12 AM
Reading and Writing data from Excel using VB? honey123 VB How-To 0 March 25th, 2006 08:48 AM
data reading from excel using VB belzicool VB Databases Basics 3 December 22nd, 2005 06:28 AM
reading first characters from a cell in excel vdriet Excel VBA 2 August 17th, 2003 11:10 AM



All times are GMT -4. The time now is 02:58 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc