+ Reply to Thread
Results 1 to 12 of 12

Excel Formating

  1. #1
    Registered User
    Join Date
    04-08-2019
    Location
    india
    MS-Off Ver
    365
    Posts
    30

    Excel Formating

    Capture.PNG

    Book1.xlsx

    Hi im extracting data from sql. the columns are converted to nvarchar. how can i freely format it in excel? to percentage or to number with comma. is not working.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Excel Formating

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    04-08-2019
    Location
    india
    MS-Off Ver
    365
    Posts
    30

    Re: Excel Formating

    Hi i have already attached in my post. The output im getting from getdata-->sql. statement as below:

    select convert(nvarchar,[total])[total],convert(nvarchar,[volume])[volume] from ... where ...
    union all
    select ''[total],''[volume]

    I couldnt change the format in excel.
    Last edited by AliGW; 06-20-2019 at 01:23 AM. Reason: Please don't quote unnecessarily!

  4. #4
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Excel Formating

    Your data is text, not number. To convert the number formatted as text to real number you can copy a blank cell and pastespecial - add into range containing number formatted as text.
    With your spreadsheet, You can follow step by step the instruction below:
    1. Copy A8
    2. Select A2:B7
    3. Right click and select Paste Special...
    4. On Paste Special windows, Choose Add (Operation group) and hit OK.

  5. #5
    Registered User
    Join Date
    04-08-2019
    Location
    india
    MS-Off Ver
    365
    Posts
    30

    Re: Excel Formating

    data will be refresh daily, everytime i need to copy and paste? is there any way i can just change the format without copy and paste it.
    Last edited by AliGW; 06-20-2019 at 01:23 AM. Reason: Please don't quote unnecessarily!

  6. #6
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Excel Formating

    If the export data is text, you have to do something to convert it to real number.
    The sql export data to new spreadsheet or a specific spreadsheet?
    Last edited by AliGW; 06-20-2019 at 01:24 AM. Reason: Please don't quote unnecessarily!

  7. #7
    Registered User
    Join Date
    04-08-2019
    Location
    india
    MS-Off Ver
    365
    Posts
    30

    Re: Excel Formating

    It will export into specific spreadsheet, upon click refreshed will overwrite the same spreadsheet. I was thinking user may play around with the formating in excel. So there's no way I can do that? Any advice. Thanks.
    Last edited by AliGW; 06-20-2019 at 01:24 AM. Reason: Please don't quote unnecessarily!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,974

    Re: Excel Formating

    Administrative Note to All Participants:

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Excel Formating

    VBA can automatically fix data for you. Put below code into the modules of sheets where sql export data.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-08-2019
    Location
    india
    MS-Off Ver
    365
    Posts
    30

    Re: Excel Formating

    can you guide how can I apply that? step by step link will be appreciate. Im new in VBA.

  11. #11
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Excel Formating

    Please follow step by step below instruction
    1. Open the file that sql will export data.
    2. Right click on tab name where sql will export data and hit 'View code', the window to write VBA code will appear.
    3. Copy that code and paste into this.
    4. Press Alt + Q to close VBA window and return Excel.
    5. Repeat step 2 to 4 for each tab you want to apply.
    6. Save as your file as type '.xlsm'.

  12. #12
    Registered User
    Join Date
    04-08-2019
    Location
    india
    MS-Off Ver
    365
    Posts
    30

    Re: Excel Formating

    thanks. is working fine now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel VBA Date is not Formating
    By Shahadat65 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2016, 11:05 AM
  2. Time Formating for Conditional Formating
    By harryhoudini66 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-14-2013, 09:33 AM
  3. Excel formating not working...
    By jepherz in forum Excel General
    Replies: 8
    Last Post: 12-23-2008, 04:41 AM
  4. Formating URL In Excel
    By mukeshpgdm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2007, 04:40 AM
  5. Replies: 3
    Last Post: 03-30-2006, 10:02 AM
  6. Formating excel
    By Bent Lauridsen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2006, 12:00 PM
  7. Install dates formating using conditional formating?
    By Jerry Eggleston in forum Excel General
    Replies: 2
    Last Post: 11-09-2005, 01:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1