Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Excel/Access Question

I have a bunch of queries in Access that I run daily. I also have an Excel
spreadsheet, and in that spreadsheet, I need to know how many results each
Access Query produced, and put that number in a different cell for each
Access Query.

Right now, I run each query manually, and type the number of records it
produced into my Excel spreadsheet... I'm looking for a way using VBA to
automatically input that number into Excel. Any ideas? Thanks in advance!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel/Access Question

On Nov 19, 4:11*am, Allen Geddes
wrote:
I have a bunch of queries in Access that I run daily. I also have an Excel
spreadsheet, and in that spreadsheet, I need to know how many results each
Access Query produced, and put that number in a different cell for each
Access Query.

Right now, I run each query manually, and type the number of records it
produced into my Excel spreadsheet... I'm looking for a way using VBA to
automatically input that number into Excel. *Any ideas? *Thanks in advance!!


Create some queries that count the number of records ie something
like:
SELECT COUNT(*) AS MyCount FROM TABLE1

Then in Excel create a sheet and select Date--Import External Data--
Import Data


Go and find your database and then link to the count query
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Excel/Access Question

Hi,

Export the whole thing to Excel, then create formulas below the data with
CountIf. It depends on what you are trying to count, but muliple formulas
referencing, in the formula, different items in a column is not hard or even
different items in different columns, again is not hard. Giving us an example
of what your are trying to count would be good. This would possibly reduce
the number of exports to different files. Depends on the data and what you
are trying to achieve in the end.

1 z
2 s
3 s
=countif(A1:A3, 1) "=1"
=countif(A1:A3, 2) "=1"
=countif(B1:B3, z) "=1"
=countif(B1:B3, s) "=2"

David

"Allen Geddes" wrote:

I have a bunch of queries in Access that I run daily. I also have an Excel
spreadsheet, and in that spreadsheet, I need to know how many results each
Access Query produced, and put that number in a different cell for each
Access Query.

Right now, I run each query manually, and type the number of records it
produced into my Excel spreadsheet... I'm looking for a way using VBA to
automatically input that number into Excel. Any ideas? Thanks in advance!!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Excel/Access Question

Thanks for the replies guys! I was able to do it using ADO and some queries
like UglyChicken suggested... but I don't have to import the entire database
every time I want to do it... so I'm happy! Thanks again!


"Allen Geddes" wrote:

I have a bunch of queries in Access that I run daily. I also have an Excel
spreadsheet, and in that spreadsheet, I need to know how many results each
Access Query produced, and put that number in a different cell for each
Access Query.

Right now, I run each query manually, and type the number of records it
produced into my Excel spreadsheet... I'm looking for a way using VBA to
automatically input that number into Excel. Any ideas? Thanks in advance!!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access to Excel Question Bunky Excel Discussion (Misc queries) 2 March 1st 09 05:14 PM
Excel / Access Question Les Stout[_2_] Excel Programming 1 May 7th 07 06:29 PM
Question about Excel & Access W. Excel Programming 1 July 26th 06 08:03 PM
Excel to Access question Stuart[_5_] Excel Programming 2 April 27th 04 08:58 AM
Excel to Access Question Nonlinear Excel Programming 1 September 19th 03 09:46 PM


All times are GMT +1. The time now is 01:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"