Open Access query in Excel with 'save formatted'

I have a query in access which is doing a group by on one field and a sum on 
another field. The query runs fine and I get one ID (group by) and a total 
(sum). 
I have a macro which will open the result of this query in Excel. When this 
runs all of the data (no group by or sum) is being sent to Excel. If I were 
to do a file export on the query and click on 'save formatted' then I get 
exactly what I want but using the macro to do the export is not allowing me 
to 'save formatted' so I am ending up with all of the data in my Excel 
spreadsheet. I am wondering if there is a way to export the query results 
only to Excel. 
Any help you can give would be appreciated. Thanks for your time.

0
Utf
1/16/2008 4:26:00 AM
access 16762 articles. 3 followers. Follow

2 Replies
1005 Views

Similar Articles

[PageSpeed] 21

IrishRed,
here is an idea - I don't know if it will suit your situation.
You can import a query from Access into Excel by starting in Excel.
Open a new worksheet, on the Menu click Data  >> Import External Data 
 >>Import Data
Navigate to the saved query in your access database and follow the prompts 
as excel guides you through the process.
If this suits your situation, it is an easy solution without any coding 
involved.

Jeanette Cunningham

"IrishRed" <IrishRed@discussions.microsoft.com> wrote in message 
news:71EA096D-7521-4B46-922A-9ABFA347A95B@microsoft.com...
>I have a query in access which is doing a group by on one field and a sum 
>on
> another field. The query runs fine and I get one ID (group by) and a total
> (sum).
> I have a macro which will open the result of this query in Excel. When 
> this
> runs all of the data (no group by or sum) is being sent to Excel. If I 
> were
> to do a file export on the query and click on 'save formatted' then I get
> exactly what I want but using the macro to do the export is not allowing 
> me
> to 'save formatted' so I am ending up with all of the data in my Excel
> spreadsheet. I am wondering if there is a way to export the query results
> only to Excel.
> Any help you can give would be appreciated. Thanks for your time.
> 


0
Jeanette
1/16/2008 9:33:34 AM
Thank you Jeanette. That was very helpful. I am getting back into Access and 
Excel after years of doing other projects that have taken me away from it.

"Jeanette Cunningham" wrote:

> IrishRed,
> here is an idea - I don't know if it will suit your situation.
> You can import a query from Access into Excel by starting in Excel.
> Open a new worksheet, on the Menu click Data  >> Import External Data 
>  >>Import Data
> Navigate to the saved query in your access database and follow the prompts 
> as excel guides you through the process.
> If this suits your situation, it is an easy solution without any coding 
> involved.
> 
> Jeanette Cunningham
> 
> "IrishRed" <IrishRed@discussions.microsoft.com> wrote in message 
> news:71EA096D-7521-4B46-922A-9ABFA347A95B@microsoft.com...
> >I have a query in access which is doing a group by on one field and a sum 
> >on
> > another field. The query runs fine and I get one ID (group by) and a total
> > (sum).
> > I have a macro which will open the result of this query in Excel. When 
> > this
> > runs all of the data (no group by or sum) is being sent to Excel. If I 
> > were
> > to do a file export on the query and click on 'save formatted' then I get
> > exactly what I want but using the macro to do the export is not allowing 
> > me
> > to 'save formatted' so I am ending up with all of the data in my Excel
> > spreadsheet. I am wondering if there is a way to export the query results
> > only to Excel.
> > Any help you can give would be appreciated. Thanks for your time.
> > 
> 
> 
> 
0
Utf
1/16/2008 5:02:01 PM
Reply:

Similar Artilces:

Opening a new instance of Excel
I am using multiple monitors for work and it is great! Is there a setting that I can use so that it opens each new excel file in a new excel window so I can drag different ones to each monitor? Is there a similar setting for Word? I am using Excel 2002 and Word 2002. Thank you. Hi, Yes, you can check the Windows in Taskbar checkbox in Tools; Options. This is on the View tab for both Word and Excel. >-----Original Message----- >I am using multiple monitors for work and it is great! Is >there a setting that I can use so that it opens each new >excel file in a new excel ...

Illegal operation error while printing EXCEL or WORD Files
Hi, I am facing an illegal operation error when i try to print any file from excel (any no. of pages), this happens in stand alone printer as well as a networked printer. When we press the print button, it flashes this message, but still prints, but once the printing is completed, i will have to restart the PC. Due to this error other applications PRINTING also will NOT HAPPEN and the only way out is, restart the PC. This happens not only in EXCEL, it happens in all the MS applications (outlook, access, front page, powerpoint also). When I check the print manager (before restart),...

how do I add times in Excel and result in hours & mins
I want to insert a time when I start work and a time when I take a break, then a time when I leave work. Following that I want to be able to add up the amount of hours that I have worked. This will enable me to plan my week ahead and ensure I only allocate a specific amount of time to a project. http://www.cpearson.com/excel/datetime.htm#WorkHours -- Kind Regards, Niek Otten Microsoft MVP - Excel "Rty Shaw" <Rty Shaw@discussions.microsoft.com> wrote in message news:37D03D72-5525-4D6E-8ED7-2911B16248B0@microsoft.com... >I want to insert a time when I start work and...

Importing Data into an Excel Pivot Table via Access
I have set up a query in Microsoft Access which is linked to our AS400 server. I have created pararmeters within Access which asks for certain fields which works. I then go into Excel and create a pivot table with the external data source that I have created in access. When I go to enter a pararmeter within Microsof Query I get a reply saying that "Parameters can not be used with this Query", what I want to do is setup a parameter on the Excel spreadsheet which then goes and gets the data i require from this parameter. I would be very grateful if someone could help me with thi...

VBA from another app: Suppressing Excel confirmation dialog?
After creating/formatting several worksheets from MS Access, I'd like to delete the "Sheetn" worksheets that got put there when I did a .WorkBooks.Add. I avoided using them because I'm not sure how/why they are created - i.e. maybe some user's defaults would only create 1 empty sheet or none. So, form MS Access's VBA I'd like to do: On Error Resume Next .Worksheets("Sheet1").Delete .Worksheets("Sheet2").Delete .Worksheets("Sheet3").Delete .Worksheets("Sheet4").Delete On Erro...

Outlook Mobile Access Problem
Hi I've a big problem in Outlook Mobile Access. I've a server exchange standalone withoput a front-end=20 one... I've configured the OWA web form authentication and SSL. For OWA it's all right...everything is going right... The problem is OMA When I try to log on on oma I find the following error=20 message :"Unable to connect to your mailbox" To solve my problem I've found in microsoft web site the=20 following link Microsoft Knowledge Base - 817379 Cannot Access Exchange Server 2003 by Using Outlook Mobile=20 Access When the Exchange Virtual Directory Require...

make column lists for select query.
sheet1 table1 col1_1 table1 col1_2 table1 col1_3 table1 col1_4 table1 col1_5 table1 col1_6 table2 col2_1 table2 col2_2 table2 col2_3 table2 col2_4 .... .... sheet2 table1 col1_1,col1_2,col1_3,col1_4,col1_5,col1_6, table2 col2_1,col2_2,col2_3,col2_4, .... .... I want to make column lists for some table listed in sheet1. for example, select column_lists from table1 without vba is it possible? thanks. I think you may want some dependent lists. http://www.contextures.com/xlDataVal02.html HTH, Barb Reinhardt "kang" wrote: > sheet1 > table1 col1_1 > table1 col1_2 >...

Emailing in excel 2003 02-26-10
If i type in the cell A34: neil.Holden@test.com and press a button is it possible to email to the address of what ever is in A34 is? The email body should say: this has been submitted for cell B34 and todays date. Thanks. Check out Ron De Bruins "Send-Mail" tips: http://www.rondebruin.nl/sendmail.htm Micky "Neil Holden" wrote: > If i type in the cell A34: neil.Holden@test.com and press a button is it > possible to email to the address of what ever is in A34 is? > > The email body should say: this has been submitted for cell B34 and...

Dates in a form for filtering Report query
I have a form "Period" with two text boxes. One for startDate and one for EndDate. I want to use that form to limit the query for my Report by the dates. However, when I refer to the Form it does not seem to understand it is a date? I use the following statement in my query: SELECT Opphold.CheckIn FROM Opphold WHERE (((Opphold.CheckIn)<=[Forms]![Perioder].[txtStartDate])); I also tried to convert it to a date like the following: CDate(<=[Forms]![Perioder].[txtStartDate]))) but that did not work? What should I do in order to the query to read the condition or dat...

Does anyone have a dashboard gauge (speedometer style) for Excel?
I am trying to create dashboard charts from Excel data and would love other templates not available in Excel today - speedometer charts, multi-dimension comparitive charts, charts that build information overlays. I regularly create these in a manual way for executive and customer summaries but would appreciate the ability to automatically generate these types of charts allowing for real time viewing of "what if" scenarios. Steve, there are tons of these things out there to review, few better than this collection: http://www.andypope.info/charts.htm Andy Pope has put together...

Excel Crash
I use Excel and Word 2003 using Windows NT. I've kept some files on a jump drive so I can work on them at home. I attempted to work on a Word documents which had an Excel worksheet inserted in it. I tried double clicking on the worksheet to edit it and Word and Excel shut down. Now when I attempt to open Excel at home it asks for my Office XP Professional installation cd. (I have Office XP at home with Windows XP). I'm having a hard time locating my original discs. Does anyone have any suggestions or experience anything like this? ...

EXCEL TROUBLESHOOTING #2
I have an excel file (2000 format), that after I made a number of changes is causing me problems when I re-open the file. Windows task manager goes to 100% CPU activity, and i cant do anything within the excel file. However, if I set recalculation to manual before I open the file, all seems fine. Obvioulsy I have a problem. But how do i find that problem ? Thanks in advance. I have had some experience running large spreadsheets lately. Above a certain size, the recalculation time seems to climb very fast. While Excel is recalculating, you can't do anything anyway. Best in my v...

Excel Edit F2 button changed for Mac???
Switched to Microsofts version of Excel for Mac. Can anyone tell me what keystroke allows me to edit a cell? Before I switched to a Mac it was the F2 button. Please help. Thank you. See the answers in the m.p.mac.office.excel newsgroup. In article <1176582208.958694.269620@q75g2000hsh.googlegroups.com>, ssears@indy.tds.net wrote: > Switched to Microsofts version of Excel for Mac. Can anyone tell me > what keystroke allows me to edit a cell? Before I switched to a Mac > it was the F2 button. Please help. Thank you. ...

Copying conditional formating
Question: I want every cell in row 2 to have red background if its value is different than the corresponding cell in row 1. I can do this to cell A2 if in the conditional formatting field I say =A2<>A1 but when I copy the formatting (using the brush), the condition continues to be A2<>A1 and not B2<>B1 for cell B and so forth. How do I copy the conditional formatting adjusting the references like the copy cells command do? Thanks. 1) Select all relevant cells in row 2. 2) Choose "Conditional Formating" > by Formula > type: =A2<>A1 > dec...

Multiple conditional formating for one cell
I have a workbook with several sheets. Sheet1 has several hundred rows of text. Some of the same text will appear in multiple rows of Sheet1. On Sheet2 I have I have a cell that allows my users to free hand type in a keyword(s) to search for in Sheet1. This cell is also has a reference name of "Special_Char". Now comes the question..... I like to for the user to type the keywork into "Special_Char" and any or all the rows in Sheet1 that contain the keyword as part of its text to turn yellow. Is there a way to do this? Please keep in mind that the keywork i...

In Excel program shows a broken line and don't know how to get ri.
I am trying to put in entries in Excel program and when I go to Print Preview, it only shows part of the entries I put in. When I go to the last entry that it shows in Print Preview, there is a broken line between it and the next entry. I don't know what I did. I could use some help You probably have multiple areas selected for your print area. you can check this by <view><page break preview> One possibility to correct this would be <file><print area><clear print area> or specifically select the area you want printed and <file ><Print area>...

Excel Cells Contents to HTML Pages
Hi, I have an excel sheet which has two columns. Column 1: PageName Column 2: HTMLCode PageName has information like: OurServices.htm which is the name of th HTML page. HTMLCode clumn has actual HTML Code like: <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html charset=windows-1252"> ...

Outlook should be able to email MS CRM advanced find queries (grou
The only way to e-mail a group in MS-CRM is to use the Quick Campaign function. The Quick Campaign has several disadvantages: - attachments for emails are not possible - this takes at least about 10 more clicks compared to sending a standard outlook email - the quick campaign doesn't have the look-and-feel of Outlook to which users are accustomed to Therefore it would be great if you could select the emailaddresses from groups retrieved from MS CRM into the TO:, CC: or BCC: field in a standard Outlook email message. Actually you would make the advanced find queries available to sel...

"floating" date query
I have a tblPersonalInfo containing information including dtmHiredDate and strJobTitle. I have another tblPromotions containing info including dtmPromoDates and strPromoTitle. This table may contain duplicate strFirstName and strLastName because of different dtmPromoDates and strPromoTitles (because same person may have multiple promotions). Another tblJobTitle_JobRates lists strJobTitles and curJobRates. A final tblHoursWorked contains information including dtmPayEndDate. I am having difficulty writing a query that would extract dates based on HoursWorked with the appropriate JobTi...

Excel to check for regular expression?
Hi, How do you use Regular expression in excel? For eg: Check a column of data to see whether are all of them valid email addresses? Please advise THanks By valid, do you mean that the email is in proper syntax or that it is an actual email address. Text formulas can be used for proper syntax. Perhaps a Visual Basic proceedure. I doubt you can check that the email address actually exists, as many companies and ISPs will simply disregard and drop mail to invalid email addresses to eliminate spam "user" wrote: > Hi, > > How do you use Regular expression ...

Does anyone know where I can download EXCEL.MSI?
I am missing my Excel 2002 CD, and can't install Office Update Service Pack 3 without this file. ...

Excel ignores boot-time regional settings when interpreting a date
I have a third party DDE app that exports dates as strings, correctly using the short date format in the regional and language settings, which, in my case is MM/DD/YYYY (reset at every boot). Unfortunately excel insists in interpreting that date as DD/MM/YYYY [Application.International(xlDateOrder)=1, it should be 0], disregarding my regional settings. The result is that all the dates are wrong or #VALUES! If this is not wierd enough, listen to this: it only happens after I reboot (when the date format is reset to MM/DD/YYYY). If subsequently I change the short date format in the regional se...

connect a form to excel database
I have a database in excel which lists our stock and prices etc. I would like to be able to enter a stock number on an invoice that will retrieve the details and price from my excel database. Can this be done? Excel has built in option--try data|form. If that doesn't quite work, but it's close, John Walkenbach has an enhanced dataform at: http://j-walk.com/ss/dataform/index.htm And if you want to design your own, Debra Dalgleish has a get started with userforms: http://contextures.com/xlUserForm01.html Kathy wrote: > > I have a database in excel which lists our stock and p...

Phone # Format
Can somebody help me with applying a format to the phone field. the default format seems to be ######### and I am looking to use (###) ###-#### Thanks in advance Dennis, I think it isn't possible at the moment. You could use the sdk and try to use postcallouts which call a webservice which puts the data in a special format and sends it back. Steffen "Dennis" <dennis_ess@hotmail.com> schrieb im Newsbeitrag news:uFrmFMGNEHA.3400@TK2MSFTNGP09.phx.gbl... > Can somebody help me with applying a format to the phone field. the default > format seems to be ######### and...

opening Excel and then closing it
I have a file that is passed to me in XLS format, but I would much prefer to work with it in CSV. So I did this... ' open the downloaded file in Excel and copy it over to L in csv format Workbooks.Open "O:\Downloads\D00100001554_0.xls" Workbooks("D00100001554_0.xls").ConflictResolution = xlLocalSessionChanges Workbooks("D00100001554_0.xls").SaveAs "L:\Activity.csv", xlCSV Workbooks("Activity.csv").Close False This works fine except it leaves Excel open in the background. The only thing to do is fine it in Processes a...