+ Reply to Thread
Results 1 to 17 of 17

Macro - How to use a Macro to capture daily statistics

  1. #1
    Registered User
    Join Date
    04-05-2017
    Location
    Ireland
    MS-Off Ver
    2007
    Posts
    45

    Macro - How to use a Macro to capture daily statistics

    Hi I have created a Macro:

    Example

    Column A Column B
    Fruits 20
    Veg 30
    Non Veg 40

    I want to capture this everyday using a Macro , I have already setup the macro which copies the data on Column C and do a Paste special and saves the file. But now the task is how will the macro run on the second day, Ideally I need the macro to move to Column D because Column C contains data of the first day. BUt the macro is created based on Column C.

    How to we configure a formula which moves to the next cell

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,951

    Re: Macro - How to use a Macro to capture daily statistics

    Rather than specify which column to paste the data in you can check for the last populated column and then enter the new data in the one next to that.
    The link below should help explain how to do all this.
    https://www.thespreadsheetguru.com/b...lumn-using-vba

    BSB

  3. #3
    Registered User
    Join Date
    04-05-2017
    Location
    Ireland
    MS-Off Ver
    2007
    Posts
    45

    Re: Macro - How to use a Macro to capture daily statistics

    Sub Macro5()
    '
    ' Macro5 Macro
    '

    '
    Range("A1").Select
    ActiveWindow.SmallScroll Down:=-9
    Range("A1").Select
    Selection.End(xlToRight).Select

    End Sub


    What code should I enter to make the macro move to the next cell right side which is empty, so my rest of the formulas can work.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,951

    Re: Macro - How to use a Macro to capture daily statistics

    Probably easier to provide a solution if you attach the workbook so we can see what you really need.

    BSB

  5. #5
    Registered User
    Join Date
    04-05-2017
    Location
    Ireland
    MS-Off Ver
    2007
    Posts
    45

    Re: Macro - How to use a Macro to capture daily statistics

    06.04.2017
    Work 05:00 05:00:00
    Cooking 04:00 04:00:00
    Playing 03:00 03:00:00
    Studying 02:00 02:00:00

    Based on the above Macro I provided data is populate on Column C, But now tomorrow I come and try to take the stats for 07/04/2017, then the 06/04/2017 data will be overridden, I need the macro work on the next column which is D.

    Sub Macro5()
    '
    ' Macro5 Macro
    '

    '
    Range("A1").Select
    ActiveWindow.SmallScroll Down:=-9
    Range("A1").Select
    Selection.End(xlToRight).Select

    End Sub

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,951

    Re: Macro - How to use a Macro to capture daily statistics

    The code you've provided simply moves the selected cell from A1 to the last populated cell in row 1. It doesn't actually do any of what you're describing.

    If you can attach the actual file, it will be clear to us what the process actually is. i.e where the data is before and where it needs to go.

    BSB

  7. #7
    Registered User
    Join Date
    04-05-2017
    Location
    Ireland
    MS-Off Ver
    2007
    Posts
    45

    Re: Macro - How to use a Macro to capture daily statistics

    the code I provide just moves to last Populated cell in the row. I need code to move it to the next cell. Excel Iam unable to attached.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,909

    Re: Macro - How to use a Macro to capture daily statistics

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on REPLY then GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  9. #9
    Registered User
    Join Date
    04-05-2017
    Location
    Ireland
    MS-Off Ver
    2007
    Posts
    45

    Re: Macro - How to use a Macro to capture daily statistics

    I Have attached the spreadsheet I need to capture the stats everyday, so the formula should move from C to D E F G H etc
    Attached Files Attached Files

  10. #10
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,951

    Re: Macro - How to use a Macro to capture daily statistics

    Hopefully the script below will help.

    Please Login or Register  to view this content.
    See attached.

    BSB
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    04-05-2017
    Location
    Ireland
    MS-Off Ver
    2007
    Posts
    45

    Re: Macro - How to use a Macro to capture daily statistics

    Unable to download attachment, can you resend

  12. #12
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,951

    Re: Macro - How to use a Macro to capture daily statistics

    Attached again as requested.

    BSB
    Attached Files Attached Files
    Last edited by BadlySpelledBuoy; 04-06-2017 at 02:26 PM.

  13. #13
    Registered User
    Join Date
    04-05-2017
    Location
    Ireland
    MS-Off Ver
    2007
    Posts
    45

    Re: Macro - How to use a Macro to capture daily statistics

    :-((( is there a way to download from this website ?

  14. #14
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,951

    Re: Macro - How to use a Macro to capture daily statistics

    Click on the filename of the attachment in post #12 or click where it says "Download" to the right of the filename.

    Navigate to the folder where your browser saves downloaded files and open it from there.

    BSB

  15. #15
    Registered User
    Join Date
    04-05-2017
    Location
    Ireland
    MS-Off Ver
    2007
    Posts
    45

    Re: Macro - How to use a Macro to capture daily statistics

    Thanks, it worked as I expected. Super

    Quote Originally Posted by BadlySpelledBuoy View Post
    Attached again as requested.

    BSB

  16. #16
    Registered User
    Join Date
    04-05-2017
    Location
    Ireland
    MS-Off Ver
    2007
    Posts
    45

    Re: Macro - How to use a Macro to capture daily statistics

    Quote Originally Posted by BadlySpelledBuoy View Post
    Hopefully the script below will help.

    Please Login or Register  to view this content.
    See attached.

    BSB
    Thanks its worked as I expected

  17. #17
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,909

    Re: Macro - How to use a Macro to capture daily statistics

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 4
    Last Post: 01-30-2017, 02:50 AM
  2. How can I capture data that is (DAILY) input into another worksheet?
    By Byrd1969 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-25-2016, 01:14 PM
  3. Replies: 4
    Last Post: 02-01-2014, 10:37 PM
  4. Daily Statistics Updates and creating of curves
    By bloynoys in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-05-2013, 09:47 PM
  5. Excel Macro for Readability Statistics
    By bairdgbaird in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2012, 04:16 PM
  6. Capture time and activity daily
    By Stormdronk in forum Excel General
    Replies: 0
    Last Post: 08-04-2011, 05:36 AM
  7. Macro to separate statistics in a spreadsheet
    By momiieee in forum Excel General
    Replies: 0
    Last Post: 02-17-2011, 02:03 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