+ Reply to Thread
Results 1 to 18 of 18

copy cells from sheets based on date, paste to another sheet

Hybrid View

  1. #1
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: copy cells from sheets based on date, paste to another sheet

    Then you need to assign a variable to stand for that cell you are trying to copy. Its hard to tell where because your code is too spaced out but:
    I think right here you'd go

    If ActiveCell.Value + Month(ActiveCell.Offset(0, 1).Value) < Today Then ' if contract start plus one frequency period is before present date
        CellAddress = ActiveCell.Address
        Call enterdata                   ' create entries on Receipts & Payments
    You need to dim CellAddress as a String.

    Then when you get to the line that was causing you trouble, you should be able to go


    ActiveCell.Value = Sheets("CoA").Range(CellAddress).Value
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  2. #2
    Registered User
    Join Date
    06-09-2008
    Posts
    28

    Re: copy cells from sheets based on date, paste to another sheet

    I did as you suggested and I am still getting a run-time error '1004', 'Application-defined or object-defined error' on the line
     ActiveCell.Value = Sheets("CoA").Range(CellAddress).Value
    Although the code fails at this point the actual date does get pasted to the second sheet: but that is as far as it goes. Any other ideas?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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