+ Reply to Thread
Results 1 to 4 of 4

Macro is changing a column width and format and I don't know why.

  1. #1
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Macro is changing a column width and format and I don't know why.

    Dear Forum.

    Sorry to be on here twice on the one day but trying to finish this spreadsheet off and am having an issue with the 'simple' macros I've tried to set up.

    Background...So I started manipulating the 'Personal Expenses Calculator' template (which mikeTRON was good enough to help me out with a pivot table question with). I have things set up the way I want however I tried to create macros that would make it easier to update the Pivot Tables (as my father will be using this and is not very computer savvy).

    There are two Pivot Tables in the spreadsheet (one on 'ExpenseBreakDn' sheet and another on 'CashFlow' sheet). Both Pivot tables are getting their data from the 'Expense Log' sheet. There are two macros. One is assigned to the 'Shape' on 'Expense Log' sheet with the text 'Expense Break Dn' and the other macro is assigned to the 'Shape' on the 'Expense Log' sheet with the text 'Cash Flow'.

    The idea is that from the 'Expense Log' sheet that the user could click on either one of these 'Shapes' to activate the macro which would then update both Pivot Tables and bring the user to the relevant sheet (which sheet depending on which 'Shape' the user clicked on).

    All seems well except for some reason it resizes the column C and removes the formatting (Currency - Euro). I had set up the columns with a width of 13 and set the currency format for the column. However when I run the macro it reduces the column to 10 and removes the '€' sign.

    Any ideas why it is doing that? Please see attached file.

    Thank you for any insight.

    BTW the macro was created using the Macro Recorder.
    Attached Files Attached Files
    Last edited by Cidona; 07-21-2016 at 08:16 PM. Reason: Additional info regarding how the macros were created.

  2. #2
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Macro is changing a column width and format and I don't know why.

    Hi Cibona,

    FIRST: For some reason, you have different formatting of the cells in Col C. viz_-"€"* #,##0.00_-;-"€"* #,##0.00_-;_-"€"* "-"??_-;_-@_-

    The other cells appear to be Accounting Euro English (Ireland) If you change Col C to the accounting format, you will hang on to the Euro symbol.

    SECOND: Go into Pivot Table Options. (Analyze Ribbon under PT Tools) and click in the box to remove the tick alongside Autofit column width on update

    I hope this helps, please let me know!

    Regards,

    David


    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  3. #3
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Macro is changing a column width and format and I don't know why.

    That worked perfect David.

    Not sure why the formatting was different. I thought I had applied the formatting the same way (obviously didn't though )

    Thank you very much for the prompt reply. I can go to sleep now

    Best Regards.

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Macro is changing a column width and format and I don't know why.

    You're welcome Cidona.

    Happy to have been able to help.

    Thanks for the Rep* - please remember to mark the thread as SOLVED

+ 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. Copy/Paste problems - Column/Row Height/Width changing
    By dlevisay in forum Excel General
    Replies: 1
    Last Post: 10-29-2014, 11:49 AM
  2. Changing the column width
    By buzzing in forum Excel General
    Replies: 4
    Last Post: 03-18-2010, 06:31 AM
  3. changing column width in the middle of a spreadsheet
    By shelleyH in forum Excel General
    Replies: 2
    Last Post: 01-14-2009, 07:37 AM
  4. Changing width of a column
    By arora in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-08-2008, 04:35 AM
  5. Changing column width
    By a_dunn69 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-21-2006, 12:18 PM
  6. [SOLVED] Stop column width from changing on pivot table....?
    By myk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2006, 12:45 PM
  7. [SOLVED] Resize individual cells w/o changing the entire column width
    By Mary Ann in forum Excel General
    Replies: 3
    Last Post: 04-28-2006, 11:45 AM

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