+ Reply to Thread
Results 1 to 6 of 6

Can't copy a locked cell when there is a command button with a macro attached to it...

  1. #1
    Registered User
    Join Date
    08-06-2014
    Location
    Tucson, Arizona
    MS-Off Ver
    XP
    Posts
    43

    Can't copy a locked cell when there is a command button with a macro attached to it...

    Hello,

    I have what I think is a very simple problem, and I'm attaching the workbook to review it (by the way, this is only an example workbook to illustrate the problem in a very simple way).

    The problem is this: When this workbook is locked, I am unable to copy the text from any cell on the workbook that isn't unlocked. The only cell that is unlocked is G16, so no problem copying the text from that box at anytime, obviously.

    The problem is that I need to be able to copy the text in cell G8 when it is locked. Just so you know, all that the command button does is erase the text in cell G16, so not that complicated of a macro.

    The password to this workbook is "lock" without the parenthesis.

    Is there any way to copy the text in G8 when locked without unprotecting or unlocking G8?

    The reason why I don't to leave G8 unlocked is because there is a formula in it and I don't want the formula to get erased.

    If you know a way to fix this, you would be the excel king of the day!

    copy me.xlsx
    Attached Files Attached Files
    Last edited by danielneedssomehelp; 08-07-2014 at 05:24 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can't copy a locked cell when there is a command button with a macro attached to it...

    when you protect the sheet you need to check the "select lock cells option"
    also you may as well check hidden on the cells protection property that will hide the formula
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by martindwilson; 08-07-2014 at 12:07 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    08-06-2014
    Location
    Tucson, Arizona
    MS-Off Ver
    XP
    Posts
    43

    Re: Can't copy a locked cell when there is a command button with a macro attached to it...

    You sir, are a genius. Thank you!!!!

  4. #4
    Registered User
    Join Date
    08-06-2014
    Location
    Tucson, Arizona
    MS-Off Ver
    XP
    Posts
    43

    Re: Can't copy a locked cell when there is a command button with a macro attached to it...

    Side question, and I think the answer is going to be "no", but can bold text contained on a command button like with the button I have in the workbook I attached? If "yes", how to do it? Thanks!

  5. #5
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Can't copy a locked cell when there is a command button with a macro attached to it...

    Forum rule:

    5. Don't duplicate threads. If you have posted the question in one forum, do not post it again in another forum. You are duplicating efforts. If you feel the thread is in the wrong forum and needs to be moved to another forum, PM a mod / admin to do it for you.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can't copy a locked cell when there is a command button with a macro attached to it...

    you can set font/bold etc.just as you would anyother text when in edit text of the button

+ 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] command button vba to copy formula from cell above
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2014, 07:29 PM
  2. Command Button Macro to Auto Filter, Copy from one file to another
    By abdulbarimd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2013, 06:42 AM
  3. [SOLVED] macro for command button to copy cell content to other cells
    By Emma_B in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2013, 06:32 AM
  4. Locked textbox clears text when command button clicked.
    By cocobean in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2012, 02:53 AM
  5. Command Button to copy conetents of one cell to another
    By Gazzauk2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2005, 12:10 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