+ Reply to Thread
Results 1 to 10 of 10

Paste Special from One Sheet to Another Where the Sheet Name is Defined in a Cell

  1. #1
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Paste Special from One Sheet to Another Where the Sheet Name is Defined in a Cell

    Hi this macro work not well:
    Please Login or Register  to view this content.
    the name this Sheets(ShtName).Select is ShtName = Range("F1").Value '<<< name sheet in cell F1
    but non work.
    In F1 there is a data validation for the choice of the sheet
    A help?
    max
    Last edited by AliGW; 02-10-2019 at 09:09 AM.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: copy sheet

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: copy sheet

    Hi bakerman.
    Your macro work well.
    I made a change and added a password:
    Please Login or Register  to view this content.
    but mistake paste special
    here : Sheets(ShtName).Range("A2").PasteSpecial xlPasteValues
    attach a esemle.
    max
    Attached Files Attached Files

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: copy sheet

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: copy sheet

    Hi bakerman.
    error paste special here class range

    With Sheets(ShtName)
    .Unprotect "987654"
    .Range("A2").PasteSpecial xlPasteValues
    Application.Goto .Range("A2")
    .Protect "987654"
    End With

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: copy sheet to another sheet

    Works just fine in your example file so something else must be in play here ?

  7. #7
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: copy special sheet to another sheet

    The title I think it's right now
    Last edited by max_max; 02-10-2019 at 08:13 AM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: copy special sheet to another sheet

    No, it isn't - sorry. Look, I will do it for you this time, but really, I should not have to. You need to do better than this in future.
    Last edited by AliGW; 02-10-2019 at 09:11 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: Paste Special from One Sheet to Another Where the Sheet Name is Defined in a Cell

    Hi bakerman2.
    I change your macro so:

    Please Login or Register  to view this content.
    it seems to me to work
    max

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Paste Special from One Sheet to Another Where the Sheet Name is Defined in a Cell

    As I said earlier, all works fine in your example file but if these modifcations work for you the better.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 19
    Last Post: 08-02-2018, 10:54 PM
  2. VBA code - copy info from sheet 1 to sheet 2 but NOT COPY BLANK CELLS
    By Yossarian1980 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2017, 06:09 PM
  3. Replies: 1
    Last Post: 02-09-2017, 05:36 AM
  4. Replies: 1
    Last Post: 02-09-2017, 05:30 AM
  5. Replies: 1
    Last Post: 06-05-2013, 07:03 AM
  6. Replies: 1
    Last Post: 01-07-2013, 12:23 AM
  7. Replies: 11
    Last Post: 10-14-2012, 01:03 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