Results 1 to 5 of 5

Change a date in a macro to a cell reference

Threaded View

  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:

    Sheets("CCL45").Select
        ActiveWindow.SmallScroll ToRight:=43
        ActiveSheet.Range("$A$1:$BH$650").AutoFilter Field:=52, Operator:= _
            xlFilterValues, Criteria2:=Array(1, "7/1/2013")
        ActiveWindow.SmallScroll ToRight:=-13
        ActiveSheet.Range("$A$1:$BH$650").AutoFilter Field:=34, Criteria1:= _
            "=PHONE FIX", Operator:=xlOr, Criteria2:="=PHONE FIX UNSUCCESSFUL"
        ActiveWindow.SmallScroll ToRight:=-24
        Range("L182:L631").Select
        Selection.Copy
        Sheets("Phone Fixing").Select
        Range("A50").Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll Down:=6
    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.

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