+ Reply to Thread
Results 1 to 8 of 8

Copy and Paste a range based on a cell value that is not static

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    Charlotte NC
    MS-Off Ver
    Excel 2007
    Posts
    31

    Copy and Paste a range based on a cell value that is not static

    Task:A user has to copy and paste a range of cells, if any row in column B has "PM" as a value.
    I have several macros/VBS scripts that copy and paste from one workbook to another, how do I create a macro that says whatever row "PM" is in copy range F:BC on that row
    My issues is the fact the PM can be in any row in column B in different sheets. Example.xlsx

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Copy and Paste a range based on a cell value that is not static

    Your discription says column B but your example shows PM in column C. Which one is it?

    Where do these values need to be pasted?

    Do all sheets need to be searched at the same time?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    04-24-2013
    Location
    Charlotte NC
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Copy and Paste a range based on a cell value that is not static

    Solus,
    Thank You for taking the time to respond. The value PM will aways be in column B, sorry for the error, in my example I added the sheet column to indicate that there would be different sheets and the value would be in differents rows.
    The sheet are done individually and they will be pasted into another workbook starting at column F Row 2.

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

    Re: Copy and Paste a range based on a cell value that is not static

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Copy and Paste a range based on a cell value that is not static

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-24-2013
    Location
    Charlotte NC
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Copy and Paste a range based on a cell value that is not static

    Souls and John Thank You very much for your help I will try both suggestions and let you know how it works.

  7. #7
    Registered User
    Join Date
    04-24-2013
    Location
    Charlotte NC
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Copy and Paste a range based on a cell value that is not static

    Souls and John I have tried both of your suggestions, but I am not able get a result, the macro run with out an error, but it does not do what I need done either. Thank You both for your help

  8. #8
    Registered User
    Join Date
    04-24-2013
    Location
    Charlotte NC
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Copy and Paste a range based on a cell value that is not static

    Thank you both for your help I have modified the code but now it fails at the paste section

    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. [SOLVED] Copy and Paste Range of Cells based on # of cell values in Column A
    By bwaite87 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2014, 05:51 PM
  2. Macro to copy and paste range based on cell value
    By msls09 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-05-2013, 12:57 AM
  3. Replies: 1
    Last Post: 10-14-2012, 09:25 AM
  4. VBA code to copy and paste range based on separate cell value
    By Mhofu in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-01-2012, 03:03 PM
  5. Finding a named range based on cell value and copy/paste to same sheet?
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2006, 06:25 PM

Tags for this Thread

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