+ Reply to Thread
Results 1 to 10 of 10

formatting

  1. #1
    Registered User
    Join Date
    06-06-2007
    Posts
    54

    formatting

    Good morning everyone, I have a pretty simple task that I am trying to accomplish, but as I am still completely incompetent when it comes to VBA I call upon your help.

    The following code opens up a new excel spreadsheet with a bunch of information pulled form an access database. I have cut out most of it, with the exception of the code relating to excel.

    Please Login or Register  to view this content.
    The following is what I need to accomplish:

    All of the columns need to be auto fit, as well as word wrapped. With the exception of the comments column, where only the heading needs to be auto fit, then the rest can be word wrapped.

    Initial inquiry date, last updated, order date need to be formated as dates.
    Blended Margin and probability of order need to be formated as percentages

    Thanks very much in advance.
    -Ben-
    Last edited by Spitfire999; 07-26-2007 at 09:22 AM.

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    Try to use this macro:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    06-06-2007
    Posts
    54
    Where should I enter it.

    Sorry, I really am pretty hopeless

  4. #4
    Registered User
    Join Date
    06-06-2007
    Posts
    54
    Actually, I was able to get it working, but for some reason the auto fit isn't doing anything

  5. #5
    Registered User
    Join Date
    06-06-2007
    Posts
    54
    Anyone have any suggestions?

  6. #6
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    I think 'AutoFit' doesn't work with wrapped text

    In this case try to add these two new rows:
    Please Login or Register  to view this content.
    before of these rows:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  7. #7
    Registered User
    Join Date
    06-06-2007
    Posts
    54
    Hmm, for some reason it still is not working, and I really don't see why It wouldn't. I don't think word wrap was being used to begin with (I suspected that there may be some conflict between wrap and autofit, and now I am sure that it is not wrapping it.

    Anything else you may suggest.

  8. #8
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    Please attache a little example of your workbook... it isn't easy to help without see the file.

    Regards,
    Antonio

  9. #9
    Registered User
    Join Date
    06-06-2007
    Posts
    54
    The code that you see above, that opens the workbook is actually in access. The macro I put above is the only thing that relates to the excel workbook. When I do run it however the output looks like the following attachment.
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    I tried to use my first code with your workbook but it seems to run fine... I don't know how help you.

    Regards,
    Antonio

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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