|
|
 |
| 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.
|
 |

December 22nd, 2004, 06:15 PM
|
|
Registered User
|
|
Join Date: Dec 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

December 27th, 2004, 08:58 PM
|
|
Registered User
|
|
Join Date: Dec 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

December 28th, 2004, 08:28 AM
|
|
Registered User
|
|
Join Date: Dec 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |