+ Reply to Thread
Results 1 to 6 of 6

Fix Date Issue then place in macro

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    Jensen Beach, FL
    MS-Off Ver
    Excel 2016
    Posts
    41

    Fix Date Issue then place in macro

    Hi! I have a report that has 4 columns with dates (not each cell has a date). I need to tally the number of scheduled calls and completed calls by manager. I would like to include this in my macro that does a bunch of other stuff to update the report. The dates come out of our system in yyyymmdd format, and I can use text to columns to change them to mm/dd/yyyy format.

    In my limited knowledge, I feel like I need to use a concatentate to get the dates all in one column, then have a formula that will identify dates that have already occured versus dates in the future, then filter by manager with a filter that will tally the number of dates in the past and the number of dates in the future (completed versus scheduled calls), then copy and paste the totals onto the main report. This seems a little unwieldly and I am betting there is an easier way to do it. Keeping in mind that all this needs to be performed by the macro without anything being done by the user other than running the macro.

    Any suggestions?

    Thanks in advance for your help!

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Fix Date Issue then place in macro

    Can you post a sample? (Go to advanced and click on the paper clip.)
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    04-23-2013
    Location
    Jensen Beach, FL
    MS-Off Ver
    Excel 2016
    Posts
    41

    Re: Fix Date Issue then place in macro

    Here is the example. I actually use Excel 2007, but that is in our network, whereas to attach this file, I had to go outside of our network so it may have reverted back to a previous version of Excel, but 2007 is what I am using.

    Thanks for looking!
    Attached Files Attached Files

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Fix Date Issue then place in macro

    Hi Spacle,

    Here's some code for a tally - I output it to sheet2:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Open your Workbook

    Save your Workbook or Another Workbook designated for Macros as Macro_Enabled

    Press ALT + F11 to open the Visual Basic Editor.

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name

  5. #5
    Registered User
    Join Date
    04-23-2013
    Location
    Jensen Beach, FL
    MS-Off Ver
    Excel 2016
    Posts
    41

    Re: Fix Date Issue then place in macro

    Thank you so much for your help! That didn't do everything I needed, but it significantly reduced the steps I had to take to get the data I needed. I combined the macro you wrote with a formula to see which dates were past versus future (I used =IF(TODAY()>C2,"Completed","Scheduled") and then used a pivot table to get each persons number of completed and scheduled calls.

    Thanks again for everything!

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Fix Date Issue then place in macro

    You're welcome!

+ 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. Macro to query column for date if found place text in cell
    By 2k05gt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2014, 06:06 PM
  2. [SOLVED] Recording a macro that will take the date from master sheet and place in the appropriate
    By nsmith10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-15-2012, 11:24 PM
  3. Excel 2007 : Date rolling macro issue
    By Nikeyg in forum Excel General
    Replies: 0
    Last Post: 03-24-2011, 08:06 AM
  4. Date issue with macro
    By Ivor in forum Excel General
    Replies: 7
    Last Post: 07-05-2010, 07:33 AM
  5. [SOLVED] Mac issue with macro recording user login & date (run time error '
    By Linking to specific cells in pivot table in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2005, 01:05 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