+ Reply to Thread
Results 1 to 6 of 6

hide and unhide a column with PASSWORD

  1. #1
    Registered User
    Join Date
    01-01-2021
    Location
    Morocco
    MS-Off Ver
    2018
    Posts
    31

    Post hide and unhide a column with PASSWORD

    Hello Team

    I have data in all my sheet and i want hide the data exist in column B this data can be display pay password, so just who have the password can see data in colum B,
    for data in rest of column can be see and modify by all

    thanks for your helping .
    Last edited by YOUSSEFam; 04-28-2023 at 02:47 PM.

  2. #2
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2502 and WPS V2024(12.1.0.18543)
    Posts
    3,866

    Re: hide and unhide a column with PASSWORD

    pls try this code

    Protect

    Please Login or Register  to view this content.
    UNProtect
    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,178

    Re: hide and unhide a column with PASSWORD

    Please note that Excel is not a secure environment. Just because column B is locked and hidden, it doesn't mean that people can't easily view the contents (and the formulae).
    Last edited by TMS; 04-28-2023 at 08:25 PM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    01-01-2021
    Location
    Morocco
    MS-Off Ver
    2018
    Posts
    31
    thanks for your answer 😊

    this macro is hide and unhide colomn B without demand of
    password, also i want let others users access to modify
    all things exist in Excel not jsut editing,
    my
    objective that users can't just see or modify data of colomn B and may do all changes in excel


    thanks

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2502 and WPS V2024(12.1.0.18543)
    Posts
    3,866

    Re: hide and unhide a column with PASSWORD

    ANS#4

    pls try this code
    Protect
    Please Login or Register  to view this content.

    UNProtect
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-01-2021
    Location
    Morocco
    MS-Off Ver
    2018
    Posts
    31

    Re: hide and unhide a column with PASSWORD

    I highly i appreciate your help, i develop little bit this code as you can find here, me still one more thing that to permit to all users to hide and unhide all columns except column B

    password = fes

    ------------------------------------
    Sub ProtectColumnB()
    ' Protect the sheet
    ActiveSheet.Protect Password:="fes", UserInterfaceOnly:=True, AllowFormattingCells:=True, AllowInsertingRows:=True
    ' Set column B as hidden and locked
    Columns("B").Hidden = True
    Range("A:XFD").Locked = False
    Range("B:B").Locked = True
    End Sub

    --------------------------------
    thanks in advance
    Attached Files Attached Files

+ 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. Unhide/ hide rows with password
    By megtoma in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-29-2023, 12:07 AM
  2. [SOLVED] How to hide and unhide sheets with a password
    By holli in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2016, 12:03 AM
  3. [SOLVED] Hide and unhide sheets with a password
    By Saturn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2016, 09:59 AM
  4. [SOLVED] Hide and unhide columns with password
    By Saturn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-14-2016, 10:07 AM
  5. [SOLVED] use of password for tab hide/unhide using vba
    By innerise in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2013, 03:36 PM
  6. VBA to Unprotect (w/ password), Unhide, Hide, and Protect (w/ password)
    By pger34 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-14-2012, 12:35 PM
  7. Command button to Hide a tab and unhide a tab with a password
    By nik63 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2011, 07:24 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