+ Reply to Thread
Results 1 to 4 of 4

CopyRange to another sheet based on combobox selection

  1. #1
    Registered User
    Join Date
    01-06-2017
    Location
    London
    MS-Off Ver
    2013
    Posts
    2

    Post CopyRange to another sheet based on combobox selection

    Hello everyone,

    I hope you can help me out. I have a workbook which has 12 sheets named by Month in order. Each sheet is identical format wise and has a list of 20 buildings written in Range H11:AV11. I am trying (and failing so far..) to create a macro, that based on my UserForm with 2 comboboxes selection (1 selection: Month - would select sheet, 2nd selection - Building) and once pressed the button would copy special (values) from source (in January sheet range G14:G41) to respective selected sheets location - Building 1 paste destination is cell H14, Building 2 - J14 (2nd cell from the Building 1) and so on.

    Hopefully it makes sense and you can put me on the right track.

    Thanks for your time reading.
    Min.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: CopyRange to another sheet based on combobox selection

    Read it a couple of time and I can't figure it out. The month sheets have Buildings in H11:AV11, but you copy from G14:G41. I don't get it.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    01-06-2017
    Location
    London
    MS-Off Ver
    2013
    Posts
    2

    Re: CopyRange to another sheet based on combobox selection

    Hi. Yes, G14:G41 in January sheet is my source where I need to get values copied from to underneath a building name. If Combobox selection is Building 1 (location H11), then copied values from G14:G41 in cell H14, if Building 2 - J14, if Building 3 - L14 in respective sheets i.e. January, February..

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: CopyRange to another sheet based on combobox selection

    Try something like this (if I understood you correctly). It uses the list index if the selected building to determine the column offset from H14 e.g; Building 1 has a list index of 0 so there is no offset. Building 2 has a list index of 1. That is multiplied by 2 and it is used as the offset from H14 to J14.

    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 the sheet based on ComboBox Value Selection
    By nawas in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-04-2016, 04:46 AM
  2. ComboBox values source being changed based on another combobox selection in a UserForm
    By stephenanderson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2016, 11:12 PM
  3. [SOLVED] Code required to Auto Populate 3rd Combobox based on 02nd Combobox Selection
    By bimmy80 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-14-2015, 03:56 AM
  4. filter and copy filtered data to another sheet based on combobox selection
    By prince82 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-09-2015, 11:09 PM
  5. Add information to specific Sheet based on ComboBox selection
    By paralegal91 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2014, 04:09 AM
  6. [SOLVED] fill combobox selection based on a selection from the first combobox
    By Monza in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-14-2013, 07:34 PM
  7. Replies: 7
    Last Post: 08-06-2013, 02:23 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