Showing posts with label Excel. Show all posts
Showing posts with label Excel. Show all posts

Thursday, August 30, 2012

How do you transfer or export SQL Server 2005 data to Excel

Option 1:
  1. Right-click the database in SQL Management Studio
  2. Go to Tasks and then Export data, you'll then see an easy to use wizard.
  3. Your database will be the source, you can enter your SQL query
  4. Choose Excel as the target
  5. Run it at end of wizard

If you wanted, you could save the SSIS package as well (there's an option at the end of the wizard) so that you can do it on a schedule or something (and even open and modify to add more functionality if needed).


Option 2:

  1. Select menu item Query > Query Options.
  2. Set check box in Results > Grid > Include column headers when copying or saving the results.

After that, when you Select All and Copy the query results, you can paste them to Excel, and the column headers will be present.


Option3:

  1. Open Excel Data>Import/Export Data>Import Data Next to file name
  2. Click "New Source" Button On Welcome to the Data Connection Wizard,
  3. Choose Microsoft SQL Server. Click Next.
  4. Enter Server Name and Credentials.
  5. From the drop down box, choose whichever database holds the table you need.
  6. Select your table then Next.....
  7. Enter a Description if you'd like and click Finish.

When your done and back in Excel, just click "OK" Easy.

Tuesday, October 12, 2010

Excel: convert seconds to minutes

An alternative to maintain your time data integrity ie. if you change the format
would be to use the following formula

=YourCell/(60*60*24)

The division by 60 * 60 * 24 is neccessary
because Excel stores all dates as integers and all times as decimal fractions. Excel takes your value as been a single day or 24 Hour
period eg enter 2 = 2days = 2 24hr periods =2*60*60*24 secs
Times are stored as decimal numbers between .0 and .99999,
where .0 is 00:00:00 and .99999 is 23:59:59

and then format your cells like this;

In the "Format cells" Dialog
Select Custom
In the "Type:" box
Type in "mm:ss"

This should give you the results as Minutes Seconds
Use the format painter to copy the custom formats to
your data range.

Tuesday, February 17, 2009

Running macro automatically on excel startup

If you record a macro and save it using the name "Auto_Open", the macro will run whenever you open the workbook that contains the macro.
If you want to save the macro with a particular workbook, open that workbook first.
On the Tools menu, point to Macro, and then click Record New Macro.
In the Macro name box, type Auto_Open.
In the Store macro in box, specify where to save the macro:
To save the macro in the current workbook, choose This Workbook.
To create a new workbook to save the macro in, choose New Workbook.
To save the macro in a hidden workbook that is automatically loaded when you start Excel, choose Personal Macro Workbook.
Note If you choose Personal Macro Workbook, Excel will create and save the macro in a hidden workbook named Personal.xls (if Personal.xls doesn't already exist). In Windows 2000, Personal.xls is saved in the C:\Documents and Settings\username\Application Data\Microsoft\Excel\XLStart folder so that it will be loaded automatically whenever Excel starts. If you want the macro you record and save in Personal.xls to act on a particular workbook, you must also save that workbook in the XLStart folder so that it will also be opened when Excel starts.
Click OK, and then perform the actions you want to record.
On the Stop Recording toolbar, click the Stop Recording button.
If you chose to save the macro in This Workbook or New Workbook in step 4, make sure to save or move the workbook into one of the XLStart folders.

Saturday, July 19, 2008

Scroll wheel doesn't work on Excel 2007

Scroll wheel doesn't work on Excel 2007

solution:
Uninstall mouse and reinstall it.
Update office 2007 and Windows.
Reboot Computer
On control panel, double click on mouse.
after update you should have two wheel tabs.
in one of them you have the option "enable universal scrolling"
click exceptions.
click add and browse.
look for excel path.
example:
"c:\program files\microsoft office\office12\excel.exe"
click ok three times.
test it. it should be ok now.