+ Reply to Thread
Results 1 to 5 of 5

Copying and Pasting a Value Once a Formula Has Run

  1. #1
    Registered User
    Join Date
    03-26-2016
    Location
    Canada
    MS-Off Ver
    2007/2010
    Posts
    3

    Copying and Pasting a Value Once a Formula Has Run

    Hello,

    I'm somewhat new to the Excel world and I keep pushing the limits of my skills trying to get it to do certain things for me.

    What I want is to save, or log, a value once a formula has run. I need to keep track of how many bed spaces are occupied on a day to day basis and log/compile that information

    I created a formula that returns a value, for that day, by counting the rows which have a name in them (meaning the room is occupied). The trouble is, once that day passes, that value is lost.

    Is there some VBA code I can run to take this value and paste it somewhere? Ideally the code wouldn't run once that date has passed.

    Below is the table I wanted to have the numbers logged into and this is the formula for the daily calculation (for cell c12): =IF(B12=TODAY(),COUNTIF('ROOMING LIST'!F6:F471,"<>"&""),"")

    I was hoping I could do something without macros or VBA, but it's not looking that way! I really appreciate any help. Cheers.

    111.jpg

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Copying and Pasting a Value Once a Formula Has Run

    A possibility could be to record a copy of the data when closing the file
    A macro can be fired
    See attached, for more detail send an Excel file
    There is 2 macros
    in a module
    Please Login or Register  to view this content.
    in ThisWorkbook module
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    03-26-2016
    Location
    Canada
    MS-Off Ver
    2007/2010
    Posts
    3

    Re: Copying and Pasting a Value Once a Formula Has Run

    Sorry, I am quite the newbie. Does the first bit of code just go in a VBA sheet and the second in a module?

    I've uploaded the xlsx. I can add another column beside each day for the value to be pasted upon each closing of the document.

    Again, much appreciated.

    I never would have thought that recording such basic data would have been such trouble.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Copying and Pasting a Value Once a Formula Has Run

    See your file updated
    There a tab named "STATISTICS_Save" to record data
    Formulas have been changed for testing purpose and are doing reference to cell A1 instead of TODAY(): Change back for your need
    See how formula are doing refrence to cell $L$2
    There is a button "Save" to update the record.
    The save treatment is launched when closing the file to remind to save data
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-26-2016
    Location
    Canada
    MS-Off Ver
    2007/2010
    Posts
    3

    Re: Copying and Pasting a Value Once a Formula Has Run

    Merci!

    Much appreciated. As I say, I'm quite new to all this and I'm a little surprised how complex a solution is required for a relatively simple issue. Even then, it's not fully automated in a sense.

    Although I'm struggling to comprehend the VBA solution in various modules (I'm trying) I do at least appreciate the clever yet simple formula for having the value displayed reverse and draw from the saved table (once a date has passed).

    Thanks again.

    Quote Originally Posted by PCI View Post
    See your file updated
    There a tab named "STATISTICS_Save" to record data
    Formulas have been changed for testing purpose and are doing reference to cell A1 instead of TODAY(): Change back for your need
    See how formula are doing refrence to cell $L$2
    There is a button "Save" to update the record.
    The save treatment is launched when closing the file to remind to save data

+ 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. Copying and pasting INDIRECT formula
    By ala4900 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-06-2013, 10:36 AM
  2. Copying/pasting cell value not formula
    By Dervlan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2010, 02:42 PM
  3. Copying and Pasting of Formula
    By calli in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-05-2008, 04:44 PM
  4. Copying/Pasting a Formula with AutoFill...
    By excel03 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2008, 01:04 AM
  5. copying and pasting a formula
    By William in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-21-2005, 08:30 PM
  6. Problem copying and pasting formula
    By Arsenalguy in forum Excel General
    Replies: 2
    Last Post: 10-07-2005, 01:05 PM
  7. [SOLVED] Trouble copying and pasting a formula
    By Julie P. in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-04-2005, 01:06 AM
  8. Copying & Pasting Formula
    By Connie Martin in forum Excel General
    Replies: 2
    Last Post: 03-03-2005, 02:06 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