+ Reply to Thread
Results 1 to 13 of 13

Macro to unlock on click, display certain column data and refresh data

  1. #1
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    51

    Macro to unlock on click, display certain column data and refresh data

    Hi

    I'm using a Ron de Bruin macro, http://www.rondebruin.nl/win/s3/win006_4.htm

    There is a list of Data on Sheet 1 and I have edited to protect the sheet. Password is 123.
    I want to edit to make the following:
    1) When I click on the button, it will auto unlock the sheet and after running the macro, it will protect back the sheet.
    I have used the macro
    Please Login or Register  to view this content.
    However, it doesn't seems to be working.

    2) How should I edit such that it will only show certain columns (e.g. Column A and C) instead of all data

    3) Lastly, and how to edit to make the data be refreshed when new data is added or existing data is deleted?

    I have attached the file for reference.
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to unlock on click, display certain column data and refresh data

    I may have missed the point - but try this:

    *Sucuri wouldn't let the code be posted hence the workbook
    Attached Files Attached Files
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    51

    Re: Macro to unlock on click, display certain column data and refresh data

    Hi, it works. Thanks.

    I tried to use the code on another excel file, I will have this error message

    Run-time error '1004':
    The command could not be completed by using the range specified. Select a single cell within the range and try the command again.

    And which I click on debug, it will highlight this code

    Please Login or Register  to view this content.
    Last edited by justin1202; 12-19-2015 at 09:52 PM.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to unlock on click, display certain column data and refresh data

    Change:

    Please Login or Register  to view this content.
    to:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    51

    Re: Macro to unlock on click, display certain column data and refresh data

    Hi, I'm very sorry for the trouble as I am still new to macro.

    I have move the code to another file.
    How can I disable the code such that if there is existing file, it will not show sheet(Error_0001) but it will refresh the sheet even when new data is added to the namelist sheet.

    I have attached my current file for reference.

    name list.xlsm

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to unlock on click, display certain column data and refresh data

    Try this:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    51

    Re: Macro to unlock on click, display certain column data and refresh data

    Hi, thanks for the fast reply.
    It will still show the "error" sheet

    Is there any way to remove this code without error
    Please Login or Register  to view this content.
    Last edited by justin1202; 12-21-2015 at 12:30 AM.

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to unlock on click, display certain column data and refresh data

    I got no error when I ran it
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    51

    Re: Macro to unlock on click, display certain column data and refresh data

    Hi, what I meant was when I first click the button to generate the unique value (gender). The sheet is fine. But when I click on the button again, it will generate another sheet with the sheet name (Error_0001). I just want the current sheet to refresh the data instead of generating another sheet.

    This is what I mean (highlighted in yellow)
    Capture.jpg

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to unlock on click, display certain column data and refresh data

    I reinstalled the RDB_Reset code(slighly altered of course)
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    51

    Re: Macro to unlock on click, display certain column data and refresh data

    Hi, you are awesome. This is what I want..

    And hope this will be my last question. If in the future I want to expand the data however, when I generate the unique value sheet, I only want certain column of data, how do I edit it?

  12. #12
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    51

    Re: Macro to unlock on click, display certain column data and refresh data

    Hi, you are awesome. This is what I want..

    And hope this will be my last question. If in the future I want to expand the data however, when I generate the unique value sheet, I only want certain column of data, how do I edit it?

  13. #13
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to unlock on click, display certain column data and refresh data

    Hi Justin,

    Thanks for the rep! I'm "at sea" about your next task

+ 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. Macro to refresh Essbase data sets, display refresh date?
    By nellaneb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2014, 03:59 PM
  2. [SOLVED] Unlock a range of cells in a column ONLY when the first cell of that column has data.
    By damienchew in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-13-2014, 12:14 AM
  3. Refresh data automatically - List only the data where one specified column is blank
    By swagatam2014 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2013, 12:56 AM
  4. Pivot - display source data filename after refresh
    By FerdieB in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-05-2012, 03:19 AM
  5. Refresh UserForm to display data that is linked to combobox selection
    By alter54 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2012, 01:30 PM
  6. Replies: 1
    Last Post: 08-30-2008, 03:57 AM
  7. When I click refresh data virus message appears
    By gmservmgr in forum Excel General
    Replies: 1
    Last Post: 04-12-2006, 07:45 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