+ Reply to Thread
Results 1 to 5 of 5

Macro to cut and paste current month sheet into the relevant month chosen by a drop down

  1. #1
    Registered User
    Join Date
    01-05-2015
    Location
    Southampton
    MS-Off Ver
    2010
    Posts
    2

    Cool Macro to cut and paste current month sheet into the relevant month chosen by a drop down

    Hi all,

    Happy New Year!

    I have a speadsheet which captures data weekly. What I need is at the end of the month the user can press a button and it just copies everything from the worksheet called "Current Month" and pastes it into a worsheet called Jan, Feb, March, April, May, June, July, Aug, Sept, Oct, Nov or Dec.
    The worksheet to paste into should be selected by the user by way of a dropdown list on the "Instructions" worksheet.
    I'm struggling with the choosing of the sheet to paste into.
    Any help would be greatly appreciated.

    Additionally, the "current Month" worksheet also has graphs on that would need to refer to the data on the Jan...Dec sheet. (This part not so important as I could just copy and paste the data only and point the graphs at the data table).

    Many thanks


    Scotty

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro to cut and paste current month sheet into the relevant month chosen by a drop do

    Perhaps something like this could be of use? Not based on a drop down list but in input box. To test run macro "CopyValue".

    Macro asks for month name and checks if there is a sheet with this name. If so old values are cleared form sheet and new values pasted in it.

    If sheet name don't excists a new sheet is created.

    Alf
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-05-2015
    Location
    Southampton
    MS-Off Ver
    2010
    Posts
    2

    Re: Macro to cut and paste current month sheet into the relevant month chosen by a drop do

    Quote Originally Posted by Alf View Post
    Perhaps something like this could be of use? Not based on a drop down list but in input box. To test run macro "CopyValue".

    Macro asks for month name and checks if there is a sheet with this name. If so old values are cleared form sheet and new values pasted in it.

    If sheet name don't excists a new sheet is created.

    Alf
    Thanks Alf - this is superb and just what I'm looking for.

    Many thanks

    Scotty

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro to cut and paste current month sheet into the relevant month chosen by a drop do

    You are welcome.

    As the macro copies from the "Current Month" most things will look alike but certain special formats are not copied i.e. row height and column with so if you really wish for an exact replica of the "Current Month" sheet one should use the "Copy worksheet" command.

    I've written a macro that does this. Work in a similar way as the previous macro i.e. asks for a month name as a starting input and if no sheet has this name it makes a copy of the "Current Month" sheet placed as the last sheet and then renaming it after the input month.

    If the month sheet exists macro will first delete this sheet and then add the "new" month sheet as the last sheet. Not to happy about that.

    What I would like to solve is how to sort the sheets in "normal" monthly order i.e. "Jan", "Feb", "Mar" . . . . but so far have found out how to do it, still a nice intellectual challenge that probably will keep me occupied for some time.

    New macro looks like this:

    Please Login or Register  to view this content.
    Alf

    Ps It seems like you problem is solved so could you please mark you thread "Solved"

    To mark your thread solved do the following:
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

  5. #5
    Registered User
    Join Date
    01-05-2015
    Location
    Southampton
    MS-Off Ver
    2010
    Posts
    2

    Re: Macro to cut and paste current month sheet into the relevant month chosen by a drop do

    Thanks again Alf - sure you'll figure out!

+ 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] Determine work days in current month or next month based on day of the month
    By sbrnard in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-29-2014, 05:14 PM
  2. [SOLVED] copy and paste entry for current month to another sheet vba
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-28-2014, 09:49 AM
  3. Replies: 12
    Last Post: 02-08-2013, 02:26 PM
  4. Macro using vlookups comparing 2 months paysheet(previous month and current month)
    By srinivasan1965 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2012, 03:45 AM
  5. Replies: 1
    Last Post: 11-22-2011, 08:11 AM

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