+ Reply to Thread
Results 1 to 1 of 1

Macro to check range, if false check another range until true, then copy

  1. #1
    Registered User
    Join Date
    12-31-2008
    Location
    Chester, CA
    MS-Off Ver
    Excel 2007
    Posts
    20

    Macro to check range, if false check another range until true, then copy

    Hi – I have been trying to work out a macro.
    I am looking for a macro that will check 2 things....then do something.
    The first is if a particular cell contains a given value. Lets say
    Please Login or Register  to view this content.
    should equal "Year 1" if true.

    Next is if a range of cell values in are blank,
    Please Login or Register  to view this content.
    should be blank.
    If both these are true then I want the macro to copy a range of cells from
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    .
    If false then move on to the next range of cells (go on to “Year 2” and its corresponding range of cells) and perform this same check until True.

    Conditions are:
    -I have five distinct ranges of cells starting with "Year 1" going through "Year 5" on Sheet1.
    -
    Please Login or Register  to view this content.
    only belongs to Year 1. The label “Year 1” is in cell D3.
    -
    Please Login or Register  to view this content.
    belongs to Year 2. The label “Year 2” is in cell I3.
    -And so on...through Year 5.
    -I have the Years listed in a combo box on Sheet2 (where I also have a button that activates this macro).
    I have tried this code, BUT I can NOT get the macro beyond simply looking at “Year 1.” I am to unfamiliar with Looping and Next to make it work here.
    Please Login or Register  to view this content.
    Thanks for your help – Jim Ayers
    Attached Files Attached Files
    Last edited by jayers; 01-26-2009 at 11:54 PM. Reason: Added all code tags

+ 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