+ Reply to Thread
Results 1 to 3 of 3

Cell sizing changes when copied by macro

Hybrid View

  1. #1
    Registered User
    Join Date
    01-21-2009
    Location
    Rugby, England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Cell sizing changes when copied by macro

    I have a workbook with three worksheets, namely “Variance”,”Template” and “Mapping”.
    “Template” has a table of dummy data laid out in the format of a financial variance report, basically three columns, actual, budget, variance and about 30 rows of income and expenditure. I have sized the cell width and height to handle the data. The first thing I would like to do is lock this block of cells sizing.
    In my worksheet “Variance”, I have a pushbutton which runs a macro that copies the table of dummy data from “Template” into “Variance”. Although that works, problem is that the cell sizing changes as I copy it. Any help on this would be appreciated.
    The next stage within the same macro, is to bring in “real” data from two other workbooks, Actuals.xls and Budget.xls which are laid out with a tab for each month and within the month, columns of income and expenditure data for 50 departments. The format of all the income and expenditure data is common throughout all worksheets/workbooks. Although I have had success in bringing data in from an open worksheet indirectly to a cell, I have not done it via a macro so any pointers would be helpful.

    Sorry it is a bit of a novel, but would appreciate any help
    Thank you.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Cell sizing changes when copied by macro

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

    problem is that the cell sizing changes as I copy it.
    Changes where? The original data? Or in the copy? You need to use a second step to copy/paste row height and column width. That will not transport with a standard copy and paste.

  3. #3
    Registered User
    Join Date
    01-21-2009
    Location
    Rugby, England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Cell sizing changes when copied by macro

    Thanks to moderator teylyn for guiding me on to the right track -
    Attached workbook has the two worksheets.
    "Template" has the correct format for a financial variance report with the cells sized to fit the data.
    "Variance" currently shows only the macro button which when pressed copies the data from "Template" to "Variance".
    Initial problem is I wish to retain the cell sizing.
    Thanks
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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