+ Reply to Thread
Results 1 to 11 of 11

Copy & Paste a range after matching a input value with a column

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Copy & Paste a range after matching a input value with a column

    Dear Friends,

    I request a macro do do the following:

    1) Take input in a dialog box
    2) As per that input, check & match with values in a column
    3) select & copy the data
    4) paste it from next to last value in a column

    I have attached a sample file in which I gave sample data and details of How & What to do.

    I request experts for their support.
    Attached Files Attached Files
    Good friends are hard to find, harder to leave, and impossible to forget.

    acsishere.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Copy & Paste a range after matching a input value with a column

    Is it what you need?
    Please Login or Register  to view this content.
    Last edited by PCI; 01-23-2021 at 05:10 PM.
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Re: Copy & Paste a range after matching a input value with a column

    Sir,

    Thanks for your code. Perfectly working.

    But, just a request. I changed a column.

    That is, need to copy & paste columns C to F only (in the previous sample, it was B to F).

    I tried changing code. But, ended up with errors.

    Please help me to resolve.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Copy & Paste a range after matching a input value with a column

    Here you are

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Re: Copy & Paste a range after matching a input value with a column

    Sir,

    Thanks for your updated code.

    But again the same issue.

    As some formula is there in Columns A4:B5001, I dont want to disturb it while executing your Code.

    Therefore, we need to copy & paste only columns C:F, only (without disturbing col A & B).

    Please Sir.

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Copy & Paste a range after matching a input value with a column

    See nexr revision.
    If does not work please attach a new Excel sample with formulas
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Re: Copy & Paste a range after matching a input value with a column

    Sir,

    As stated, I hereby attached the Sample file with your latest code.

    Also, mentioned the formulas in Column A & B which are not to be disturbed.

    Request your kind support.
    Attached Files Attached Files

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Copy & Paste a range after matching a input value with a column

    You need to lock row in the formula
    B4 =IFERROR(VLOOKUP(C4,Sheet2!$B$1:$C$21,2,FALSE),"")


    Then try

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Bo_Ry; 01-24-2021 at 01:56 PM.

  9. #9
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Copy & Paste a range after matching a input value with a column

    As Bo_Ry mentioned it, keep in mind to freeze the range of the Vlookup
    In the next code formulas are copied down
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Re: Copy & Paste a range after matching a input value with a column

    Thanks a lot to PCI & Bo_Ry.

    I got the solution.

  11. #11
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Copy & Paste a range after matching a input value with a column

    You're welcome and thanks for the rep.

+ 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. New to VBA, simple copy and paste range of cells based on input box, NEED HELP
    By PNick in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-12-2017, 04:26 PM
  2. Replies: 3
    Last Post: 03-31-2017, 02:43 PM
  3. [SOLVED] Search for multiple matching cells and copy/paste range?
    By papercut in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2014, 11:24 AM
  4. [SOLVED] Copy Range And Paste It As Link On Another Sheet With Using Input Box
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-08-2014, 05:21 AM
  5. Use input box for values then copy and paste into column
    By eonizuka in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-19-2009, 04:35 PM
  6. Copy input range and paste into Format Control
    By Tibby in forum Excel General
    Replies: 2
    Last Post: 10-28-2008, 04:39 PM
  7. Input box Copy Paste Range
    By JavyD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2005, 06:50 PM

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