473,396 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Pulling Data from an Excel Workbook.

Alright, I've got a bit of a dilemma so I figured I would actually ask
for some help.

My girlfriend and I have been working on a program that she got
commissioned to do for her brother and the gas station that he works
at. It's a fairly straight-forward program; they are wanting to be
able to save gas prices at various stations and the sort so that they
can pull it up later and compare them (don't ask why the store owner
doesn't set up particular workbooks and the sort). We've gotten down
having the form take the textbox entries from 5 tabs and saving it all
to a 5 paged workbook. I also have (I think) the printing down with
the simple xlApp.ActiveWorkbook.PrintOutEx.

However, the problem that we are having seems to have an elusive
answer: Once we have a workbook loaded to read from, how do we take
the contents of a particular cell or a range of cells and bring it up
in a textbox or group of textboxes?

Aug 17 '07 #1
3 3047
On Aug 17, 1:38 pm, "lmeff...@gmail.com" <lmeff...@gmail.comwrote:
Alright, I've got a bit of a dilemma so I figured I would actually ask
for some help.

My girlfriend and I have been working on a program that she got
commissioned to do for her brother and the gas station that he works
at. It's a fairly straight-forward program; they are wanting to be
able to save gas prices at various stations and the sort so that they
can pull it up later and compare them (don't ask why the store owner
doesn't set up particular workbooks and the sort). We've gotten down
having the form take the textbox entries from 5 tabs and saving it all
to a 5 paged workbook. I also have (I think) the printing down with
the simple xlApp.ActiveWorkbook.PrintOutEx.

However, the problem that we are having seems to have an elusive
answer: Once we have a workbook loaded to read from, how do we take
the contents of a particular cell or a range of cells and bring it up
in a textbox or group of textboxes?
You can use the worksheet's .Range() method to select a single or
range of cells.

IIRC Range("A1") selects a single cell, while Range("A1:B3") would
select the group of cells. You should look up the Range() function in
the Object Browser or using Excel's VBA help - it should give you
sample code.

Also, do you have to use Excel? If all the information is set and
retrieved through your program it would probably be easier to use an
Xml file or a dedicated database for this.

Thanks,

Seth Rowe

Aug 17 '07 #2
On Aug 17, 1:16 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 17, 1:38 pm, "lmeff...@gmail.com" <lmeff...@gmail.comwrote:
Alright, I've got a bit of a dilemma so I figured I would actually ask
for some help.
My girlfriend and I have been working on a program that she got
commissioned to do for her brother and the gas station that he works
at. It's a fairly straight-forward program; they are wanting to be
able to save gas prices at various stations and the sort so that they
can pull it up later and compare them (don't ask why the store owner
doesn't set up particular workbooks and the sort). We've gotten down
having the form take the textbox entries from 5 tabs and saving it all
to a 5 paged workbook. I also have (I think) the printing down with
the simple xlApp.ActiveWorkbook.PrintOutEx.
However, the problem that we are having seems to have an elusive
answer: Once we have a workbook loaded to read from, how do we take
the contents of a particular cell or a range of cells and bring it up
in a textbox or group of textboxes?

You can use the worksheet's .Range() method to select a single or
range of cells.

IIRC Range("A1") selects a single cell, while Range("A1:B3") would
select the group of cells. You should look up the Range() function in
the Object Browser or using Excel's VBA help - it should give you
sample code.

Also, do you have to use Excel? If all the information is set and
retrieved through your program it would probably be easier to use an
Xml file or a dedicated database for this.

Thanks,

Seth Rowe
Well we don't have to but considering we don't have a lot of
experience with databases as well as the fact that the excel workbook
takes a lot less space we decided to go with something that would
still stand even if, for some unforseen reason, our program failed to
do something. The woman we are doing this for is extremely computer
illiterate and as such if something went wrong with our computer, she
would be in the dark as to how to use the database or an xml. Both of
those options were looked at, though.

Aug 17 '07 #3
On Aug 17, 1:21 pm, "lmeff...@gmail.com" <lmeff...@gmail.comwrote:
On Aug 17, 1:16 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 17, 1:38 pm, "lmeff...@gmail.com" <lmeff...@gmail.comwrote:
Alright, I've got a bit of a dilemma so I figured I would actually ask
for some help.
My girlfriend and I have been working on a program that she got
commissioned to do for her brother and the gas station that he works
at. It's a fairly straight-forward program; they are wanting to be
able to save gas prices at various stations and the sort so that they
can pull it up later and compare them (don't ask why the store owner
doesn't set up particular workbooks and the sort). We've gotten down
having the form take the textbox entries from 5 tabs and saving it all
to a 5 paged workbook. I also have (I think) the printing down with
the simple xlApp.ActiveWorkbook.PrintOutEx.
However, the problem that we are having seems to have an elusive
answer: Once we have a workbook loaded to read from, how do we take
the contents of a particular cell or a range of cells and bring it up
in a textbox or group of textboxes?
You can use the worksheet's .Range() method to select a single or
range of cells.
IIRC Range("A1") selects a single cell, while Range("A1:B3") would
select the group of cells. You should look up the Range() function in
the Object Browser or using Excel's VBA help - it should give you
sample code.
Also, do you have to use Excel? If all the information is set and
retrieved through your program it would probably be easier to use an
Xml file or a dedicated database for this.
Thanks,
Seth Rowe

Well we don't have to but considering we don't have a lot of
experience with databases as well as the fact that the excel workbook
takes a lot less space we decided to go with something that would
still stand even if, for some unforseen reason, our program failed to
do something. The woman we are doing this for is extremely computer
illiterate and as such if something went wrong with our computer, she
would be in the dark as to how to use the database or an xml. Both of
those options were looked at, though.
Ah! I've found it. Since we have each of the 5 worksheets set to
different variables it is fairly simple now that I have got the
Range() function working the way I wanted it to:
worksheetvariable.range("cell").value
gave me the precise results.

Aug 17 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Ksenia Marasanova | last post by:
Hi, I have a little problem with encoding. Was hoping maybe anyone can help me to solve it. There is some amount of data in a database (PG) that must be inserted into Excel sheet and emailed....
3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
1
by: Alex | last post by:
Hi all, I've seen this noted in many posts, but nothing I've checked out gives me any clue on how to do this. Basically as my topic says, I have a DTS and I simply need to export some data...
0
by: eyal | last post by:
Hello, I want to open 2 workbook, , lets say workbook1 and workbook2 now I want to copy data from a sheet name "TEST" in workbook2 and paste the data to a sheet named "TEST" in workbook. now...
1
by: david shapiro | last post by:
I've created an excel workbook with several worksheets. In each worksheet, I've highlighted a number of the cells containing key statistics in red. Is there any easy one-step way that I can pull...
1
by: gssstuff | last post by:
Hi I have a need to send data from Access to an existing Excel template that I am using for reporting purposes. The nature of the data in the Access data table does not lend itself to a simple...
10
by: Niklas | last post by:
Hi Before I start coding I need to be sure that nobody else has not done it yet and that I can use it. I need an import utility which import data from Excel to a database or some object in...
7
by: Vanessa | last post by:
hi Everyone, I have two questions on exporting data to Excel using ASP (w/o converting formatted excel file into web page and then plug in the dynamic data): 1. Can we export data into...
4
by: omono84 | last post by:
I know that this should be rather simple but i seem to be missing a step to get it to work. and have been unable to find a solution on the net. The aim is that I click on the open button to find...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.