+ Reply to Thread
Results 1 to 19 of 19

Solution to copy a range of cells and paste in another Worbook w/o using an input box

  1. #1
    Registered User
    Join Date
    01-12-2014
    Location
    Plano, Tx
    MS-Off Ver
    Excel 2007
    Posts
    54

    Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Is there a way to copy a range of cells instead of using an Input Box. The cells I need are from A1 to E1 and then I know you could use xlDown from the E1cell. Here is my current code w/Input Box. I tried this but it didn't work: Set FromRange = Range(Cells(1, 1), Cells(44, 5)).Copy. The code I'm referring to is right after Workbooks(1).Activate

    Thanks Ken Mc.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Hi Ken

    Lets ignore the above code for now and explain in detail what you would like to achieve. Attach a sample workbook with a required result highlighted.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    01-12-2014
    Location
    Plano, Tx
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Ok, I will do that in just a bit. Thank you Sintek.

  4. #4
    Registered User
    Join Date
    01-12-2014
    Location
    Plano, Tx
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Ok, here it is. On the "E" column, we will need to use xlDown because some districts have more stores than this one, and some fewer. Thank you
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-12-2014
    Location
    Plano, Tx
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Do you need the other file I paste it to?

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Please, I would like to assist but still have no idea what you are requiring

  7. #7
    Registered User
    Join Date
    01-12-2014
    Location
    Plano, Tx
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    The code starts out from this file by clicking "Import This Week", it asks the user to open the file which is the first file I sent you. Then it asks the user to copy the columns from A1 to E1 and then down to the last store and then it pastes it into the InMoment file and then it deletes ever other row to get rid of duplication. Then it asks to open another file, but I don't need anything after that. That part is all good. Hope that explains it.
    Attached Files Attached Files

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Hi Ken

    i am very certain that there is a simpler way to do this. Must your code do the following:
    1. Open the required workbook
    2. Select the entire range A to E all available rows and paste it into your workbook

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Such as...This code will select range A2 to LastRow of E
    Please Login or Register  to view this content.

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    @ sintek,

    Hallo daar sintek,

    This code will select range A2 to LastRow of E
    This should actually read "to LastRow of A" wich will include all the data contained in Column E down to that specified LastRow. However, if Column E contains more Rows than Column A, your Code should be:

    Please Login or Register  to view this content.
    Dankie jy.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    @ Winon

    Aha...hallo daar Winon.

    Lekker om van jou te hoor....Was wondering if you were going to find my error....Testing testing

    Ha ha just kidding. Thanks for the assist...I'm come a long way lol...getting there slowly but surely

  12. #12
    Registered User
    Join Date
    01-12-2014
    Location
    Plano, Tx
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Ok Sintek and Winon , that worked perfectly. I sincerely appreciate the help with this. Both of you guys are gems!
    Ken Mc

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Ken...Play around with this...Much simpler
    Please Login or Register  to view this content.
    Last edited by sintek; 03-29-2017 at 02:11 PM.

  14. #14
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    @ sintek,

    Hi sintek,

    Na watter Workbook verwys jy, om die kode in te gebruik?

    It is important to place the Code in the correct relevant Workbook.

    Thank you for the feedback kwesmc1.

    Does sintek's proposed solution work for you? I would very much like to assist where I can, whilst giving sintek the credit!

  15. #15
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    The code should go into he's Command button [IMPORT THIS WEEK] in Workbook named Inmoment-Period_Unit.xls
    Works when tested.

  16. #16
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    @ sintek,

    Thanks for the clarification, seems the OP got the gist of your response. Well done!

    Beste Groete.

  17. #17
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    @ Winon

    Wow, now I feel absolutely awesome....Rep points from one of my Forum Mentors....Dankie Skat. Beteken baie.

  18. #18
    Registered User
    Join Date
    01-12-2014
    Location
    Plano, Tx
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Thank you. On the 2nd part of the routine, there is one more input box on the InMoment file. Is it possible to do more or less the same thing you did for the first part of the code? All I need is to copy on the file from E2 down and then paste it in the Div 4 Report Card file. Both files are attached.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    01-12-2014
    Location
    Plano, Tx
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Solution to copy a range of cells and paste in another Worbook w/o using an input box

    Did either of you guys get my last post, or do I need to start a new one?

+ 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 row, find in another worbook and paste
    By Infish in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-10-2014, 08:14 AM
  2. [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
  3. Macro to copy and paste values from diff sheets into a template worbook
    By bloom1439 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 10:25 AM
  4. Copy input range and paste into Format Control
    By Tibby in forum Excel General
    Replies: 2
    Last Post: 10-28-2008, 04:39 PM
  5. Copy paste from one worbook to another workbook
    By mmf in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2008, 01:00 PM
  6. Copy paste from one worbook to another workbook
    By chrisrasburn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2008, 07:29 PM
  7. [SOLVED] 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