+ Reply to Thread
Results 1 to 3 of 3

Reset formula in macro

Hybrid View

  1. #1
    Registered User
    Join Date
    10-18-2007
    MS-Off Ver
    2010
    Posts
    90

    Reset formula in macro

    Good afternoon,
    I have a worksheet, '2008 Sales', for sales people to project their sales that uses a sumproduct formula to pull in information based on prior years. They are allowed to override the sumproduct formulas with their projection if they disagree with the formula result (for example if they know a product line is going to be dropped in a certain account's store and wish to adjust the value down). I also have a macro button that they click on to select which account they wish to work on and a macro button to copy worksheet once they have completed their changes.

    What I need is for the original worksheet, '2008 Sales', to reset the sumproduct formulas as they were when the workbook was opened so if they work with another account the formulas are all there. Also please note these formulas are in 51 rows and 13 columns.

    I think I can add something to the macro assigned to copy worksheet button, but I just don't know how to do it. Please let me know if I am not describing this well.

    If you can lend any assistance, I would greatly appreciate it.

    N

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    How about something like

    Range("B2").Formula = "=2*2"
      Range("B2").AutoFill Destination:=Range("B2:B52")
      Range("B2:B52").AutoFill Destination:=Range("B2:N52")
    replace the =2*2 with your sumproduct formula copied directly from the workbook and adapt to cover any " that may exist.

    adjust your ranges as required.

    HTH

    rylo

  3. #3
    Registered User
    Join Date
    10-18-2007
    MS-Off Ver
    2010
    Posts
    90
    I had to modify slightly since my cells to paste to weren't all adjacent, but otherwise worked great. Thanks Rylo!

    N

+ 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