+ Reply to Thread
Results 1 to 8 of 8

macro copy paste on protect sheets and hidden within the same workbook

  1. #1
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    macro copy paste on protect sheets and hidden within the same workbook

    hello

    I have a problem, which is as follows.

    I made this macro that can be seen below (with a little help is truth).

    problem now is the following:

    when the sheet that will receive the copy is protected with password, do nothing get nothing ...

    What I do regret to add or?


    COPIARCOLAR sub ()
    '
    'Macro COPIARnovaforma
    '

    Sheets ("new way"). Select
    Range ("a12"). Select
    Range ("a12: ah112). Select
    Selection.Copy
    Sheets ("new map"). Select
    Range ("a12"). Select
    Selection.PasteSpecial Paste: = xlPasteValues, Operation: = xlNone, _ SkipBlanks
    : = False, Transpose: = False
    Application.CutCopyMode = False
    Range ("a12"). Select
    End Sub
    Last edited by Birnen; 08-30-2010 at 01:29 PM.

  2. #2
    Forum Contributor
    Join Date
    11-27-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2003, 2007 and 2010
    Posts
    120

    Re: macro copy paste whit problem

    Hey,

    You need to use

    Please Login or Register  to view this content.
    You will need to enter the password though if it is pasword protected. Im not sure if you can code the password into the macro

    Hope this helps

  3. #3
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Unhappy Re: macro copy paste whit problem

    Quote Originally Posted by t0m46 View Post
    Hey,

    You need to use

    Please Login or Register  to view this content.
    You will need to enter the password though if it is pasword protected. Im not sure if you can code the password into the macro

    Hope this helps
    OK
    Now my doubt is where do I put this code in the macro???

  4. #4
    Forum Contributor
    Join Date
    11-27-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2003, 2007 and 2010
    Posts
    120

    Re: macro copy paste

    Hey, Sorry for the late reply.

    Please Login or Register  to view this content.
    You would insert them like this, after you have selected the sheet and before you select another sheet.

  5. #5
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: macro copy paste

    friends

    Once again I ask your help for this project ...

    is that besides not being able to enter the codes to copy paste in protected sheets, I have another problem as serious as this.

    is to set the macro to go from one sheet, ie the principal to another that is hidden within the same workbook.

    : (

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: macro copy paste on protect sheets and hidden within the same workbook

    1) You do not have to "activate" a sheet to use VBA to do stuff to that sheet. Simply address your commands directly to that sheet.

    2) You do not have to "unprotect" a sheet for VBA to be able to make changes to it, simply set the UserInterfaceOnly flag for that worksheet.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Forum Contributor
    Join Date
    08-10-2010
    Location
    Tavira, POrtugal
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: macro copy paste on protect sheets and hidden within the same workbook

    Quote Originally Posted by JBeaucaire View Post
    1) You do not have to "activate" a sheet to use VBA to do stuff to that sheet. Simply address your commands directly to that sheet.

    2) You do not have to "unprotect" a sheet for VBA to be able to make changes to it, simply set the UserInterfaceOnly flag for that worksheet.

    Please Login or Register  to view this content.

    and for the leaves that are hidden in the same book?

    it is there that will be recorded which is copied.

    and also click on the check sheet (hidden) in the main sheet?

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: macro copy paste on protect sheets and hidden within the same workbook

    You can address commands to hidden worksheets, you cannot "activate" them without unhiding them. But you don't need to do that anyway.

    I do not understand your second two sentences.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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