+ Reply to Thread
Results 1 to 7 of 7

Copy and Paste Cells from multiple worksheets based on Input Box range

  1. #1
    Registered User
    Join Date
    02-16-2018
    Location
    Lagos
    MS-Off Ver
    MS Office 2016
    Posts
    25

    Copy and Paste Cells from multiple worksheets based on Input Box range

    Hello All,

    I would appreciate if anyone can help with this.

    I have multiple worksheets in the workbook 'Report Sheets' attached below labelled accordingly by dates (format: 01-01-2018) and I would like to loop through these sheets based on an input box that allows user to specify which range of sheets to copy cell values in B23, F4, J4, N4 from by the sheet name e.g. 02-03-2018:04-03-2018 to cells E4, F4, G4, H4 respectively on a new sheet using the file 'extracted' attached below as a template

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Copy and Paste Cells from multiple worksheets based on Input Box range

    Save your workbook 'Report Sheets' as a macro enabled workbook and copy the code below to code module1. If you do not currently have a public code module, then open the vb editor (Alt + F11), click Insert on the editor menu bar and then click Module.
    Please Login or Register  to view this content.
    This code assumes both workbooks are open at run time.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    02-16-2018
    Location
    Lagos
    MS-Off Ver
    MS Office 2016
    Posts
    25

    Re: Copy and Paste Cells from multiple worksheets based on Input Box range

    Thank you JLGWhiz.. Looks good but I seem to be getting error "Object doesn't support this property or method" at

    Please Login or Register  to view this content.
    Quote Originally Posted by JLGWhiz View Post
    Save your workbook 'Report Sheets' as a macro enabled workbook and copy the code below to code module1. If you do not currently have a public code module, then open the vb editor (Alt + F11), click Insert on the editor menu bar and then click Module.
    Please Login or Register  to view this content.
    This code assumes both workbooks are open at run time.

  4. #4
    Registered User
    Join Date
    02-16-2018
    Location
    Lagos
    MS-Off Ver
    MS Office 2016
    Posts
    25

    Re: Copy and Paste Cells from multiple worksheets based on Input Box range

    I eventually got a hang of it after a few struggles 'cos I'm still learning. I made a few adjustments as shown below:

    Please Login or Register  to view this content.
    However, I would like know how I can apply it to the same workbook if the multiple sheets to be referenced were more than 5 sheets, say over 50 sheets labelled as dates

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Copy and Paste Cells from multiple worksheets based on Input Box range

    However, I would like know how I can apply it to the same workbook if the multiple sheets to be referenced were more than 5 sheets, say over 50 sheets labelled as dates
    I don't understand the question. It should make no difference how many sheets you have. This line of code
    Please Login or Register  to view this content.
    will set the parameters for the sheets to be worked, so long as your target sheets are consecutive and have no blank sheets interspersed among them.
    Last edited by JLGWhiz; 07-19-2018 at 08:45 AM.

  6. #6
    Registered User
    Join Date
    02-16-2018
    Location
    Lagos
    MS-Off Ver
    MS Office 2016
    Posts
    25

    Re: Copy and Paste Cells from multiple worksheets based on Input Box range

    Quote Originally Posted by JLGWhiz View Post
    I don't understand the question. It should make no difference how many sheets you have. This line of code
    Please Login or Register  to view this content.
    will set the parameters for the sheets to be worked, so long as your target sheets are consecutive and have no blank sheets interspersed among them.
    Yea! tried it.. works like a charm. Thank you so much. Kudos!

  7. #7
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Copy and Paste Cells from multiple worksheets based on Input Box range

    Quote Originally Posted by oloyejawnson View Post
    Yea! tried it.. works like a charm. Thank you so much. Kudos!
    You're welcome,
    regards, JLG

+ 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] Solution to copy a range of cells and paste in another Worbook w/o using an input box
    By kwesmc1 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 03-29-2017, 06:41 PM
  4. Cut and paste a range of cells based on user input
    By MICHAEL BIZ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-24-2015, 01:51 PM
  5. Copy and paste based on multiple input/textboxes
    By siobeh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2014, 08:43 PM
  6. Copy/Paste Range of Data from Multiple Workbooks/Worksheets to Master Workbook/Worksheets
    By NumberCruncher311 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-19-2013, 08:21 PM
  7. Replies: 3
    Last Post: 12-27-2012, 12:19 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