Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
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 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 December 22nd, 2004, 06:15 PM
Registered User
 
Join Date: Dec 2004
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
 
Old December 27th, 2004, 08:58 PM
Registered User
 
Join Date: Dec 2004
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

 
Old December 28th, 2004, 08:28 AM
Registered User
 
Join Date: Dec 2004
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






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 10:10 AM





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