+ Reply to Thread
Results 1 to 25 of 25

Find cells with today's date and copy asscoiated range

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Find cells with today's date and copy asscoiated range

    Hello,

    I have a spreadsheet where various dates are in column T.

    I require a vba code or macro that will do the following:

    Select all the rows in the range ("T:BP") where the date in T is today's date. Then copy the selection

    This must be simple but for some reason i am just not getting it!

    Would appreciate any help

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    Maybe:

    Please Login or Register  to view this content.
    Untested, try on a copy first.

  3. #3
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Please Login or Register  to view this content.
    Untested, try on a copy first.
    Hi,

    Thanks for your response

    I tried the code with my sheet but nothing is copying

    What does the 20 refer to in
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    When I get home, I will upload an example as i cannot do it from work

    Thanks

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    The 20 refers to the Column Number (T). I didn't test it can you provide a sample?

  6. #6
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    When I get home, I will upload an example as i cannot do it from work

    Thanks

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    I just tested it and it worked on the sample I created. I used Sheet 2 for a destination sheet since you didn't mention a destination in your thread. Is there data filled in in Column T from the top row to the last row? It can be amended to another row if needed.

  8. #8
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    Hi,

    Column T has dates in it. I want to select all the cells in T which have today's date in them and all the cells along those rows up to column BP

    I don't need a paste function as I already have a paste macro which does some specific things.

    Much appreciated

  9. #9
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    I think I need something which does something like

    Look down column T
    Find all the cells with today's date
    select those cells and all the cells to the right of them up to column BP
    Copy all the selected cells

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    Does this help?

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    Hello,

    I tried all the codes in excel 2010 and I think I will use the following code that you sent previously and amend the paste function that I already have:

    Please Login or Register  to view this content.
    Do you think that this code will work in excel 2003?

    I can't try it until I get to work on monday

    By the way, what does the
    Please Login or Register  to view this content.
    mean in the code?

  12. #12
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    I have another query,

    I have attached the excel file (which has the previous vba code that you helped me with)

    How can I tell the excel sheet to do the following:

    If column U is empty then delete the contents of the cell in T of the same row

    I have put a command button on the excel sheet for you (labelled 2. find empty U and delete T), so that you can test any code you come up with

    Appreciated

    Paula
    Attached Files Attached Files
    Last edited by paulary30; 12-07-2012 at 07:57 PM. Reason: did not make myself clear

  13. #13
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    It should work in 2003, that's what I have. It should however work in 2010 as well. The (3) means xlUp and the (2) is an offset command.

  14. #14
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    Quote Originally Posted by paulary30 View Post
    I have another query,

    I have attached the excel file (which has the previous vba code that you helped me with)

    How can I tell the excel sheet to do the following:

    If column U is empty then delete the contents of the cell in T of the same row

    I have put a command button on the excel sheet for you (labelled 2. find empty U and delete T), so that you can test any code you come up with

    Appreciated

    Paula

    A small sample:

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    The code is having a problem with
    Please Login or Register  to view this content.


    I changed U2 to U3 for the purpose of my sheet but the code has a problem either way

  16. #16
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    Are you incorporating this into the previous macro? Otherwise you'd have to define the last row variable (lr)

    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    Thank you very much

    It works now - It had it's own command button so the second lot of code worked

    OK - I posted a thread a while back and no one has been able to help me. I would really appreciate it if you could have a look.

    Do you mind? If not I will try and find it and post on this thread

  18. #18
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    You're are very welcome. Glad to help out, and thanks for the feedback. If you bump the older thread I would gladly take a look at it and see if I can help in any way.

  19. #19
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    Aseries example_3.xls

    Hello Forum Users,

    Please could someone see if they could help me with a couple of points that I am stuck at regarding the attached spreadsheet:

    I have two command buttons on the first worksheet called 'form'. One brings up a userform called 'formseries' which completes and uploads from the second worksheet 'Aseries'. The other command button brings up a userform called 'findForm' which allows me to search for records that are already on 'Aseries'.

    I can currently search for a word on the 'findForm' - this brings back a list of records. I can then choose the record that I want by clicking on the relevant one in the list and highlighting it. What I want to do which I can't at the moment is:

    Using the select button upload the highlighted record into the main form called 'formseries' so that I can edit it.


    This leads me to the second problem. I can open the main form 'formseries' and travel through the records using the direction buttons at the top. I can also change a record by unticking and ticking etc. However when I change the record then save the record it saves it on an empty row. I want to be able to:

    Overwrite the record on the same row that it came from

    Any assistance is welcome

    Thank you in advance

  20. #20
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    If I were you I would start another thread.

  21. #21
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    I have and I just copied this to you also

    If you can't help no worries

    Thanks for everything so far

  22. #22
    Registered User
    Join Date
    10-25-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Find cells with today's date and copy asscoiated range

    Hello,

    Me again

    I am now at work and have used the formula that you wrote for me and it works

    Please Login or Register  to view this content.
    It all works but I have formuals in my original cells so when they copy over to the other sheet, the formulas copy.

    How can I get the code to paste special the copied cells over?

    Thanks again in advance

  23. #23
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find cells with today's date and copy asscoiated range

    Try this:

    Please Login or Register  to view this content.

  24. #24
    Registered User
    Join Date
    12-20-2010
    Location
    athens
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Find cells with today's date and copy asscoiated range

    Data must be
    vertically
    not horizontal
    In the attached example
    THANKS
    Attached Files Attached Files

  25. #25
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Find cells with today's date and copy asscoiated range

    Manos77,

    Are you asking a question or posting a solution? If its the former,

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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