+ Reply to Thread
Results 1 to 5 of 5

Change a date in a macro to a cell reference

  1. #1
    Registered User
    Join Date
    10-07-2013
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2010
    Posts
    8

    Smile Change a date in a macro to a cell reference

    Hello,
    I have just started trying to use macros and have built one which copies and pastes data from one sheet to another sheet, based on certain criteria.
    One of these criteria is the month - at the moment this is a fixed date but I need this to be a cell reference. Then, when you update the cell reference to a different value, the data which is returned will change.
    The macro is as below:

    Please Login or Register  to view this content.
    And it's the '7/1/2013' I want to be able to change to a cell reference. Help much appreciated, thanks!
    Last edited by ClaireH; 10-08-2013 at 05:37 AM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Change a date in a macro to a cell reference

    Claire - please add code tags as per forum rules.

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Change a date in a macro to a cell reference

    Try this - Untested code

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    10-07-2013
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Change a date in a macro to a cell reference

    Hello,

    No....that didn't work :-(

    I got an error saying 'compile error - Statement invalid outside Type block'.

    Any clue?

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Change a date in a macro to a cell reference

    Oopss... try this...

    Refer it to your range

    Please Login or Register  to view this content.

+ 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 Change color of cell after cross referencing date with a given date.
    By liajet24 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 12:33 PM
  2. [SOLVED] Change Year in Macro with reference to cell in Working code.
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2013, 02:11 PM
  3. Formula/Script to change reference cell based on date?
    By rbtroj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2012, 11:56 AM
  4. Change a macro to from and absolute cell reference to selected cell.
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2010, 01:19 PM
  5. Change cell reference depending on date
    By freud1 in forum Excel General
    Replies: 2
    Last Post: 06-11-2009, 08:07 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