+ Reply to Thread
Results 1 to 4 of 4

input box and lock the table and particular cells to user can acess

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Talking input box and lock the table and particular cells to user can acess

    HI Buddy's,

    i need the code for the input box for Entering value in column "C" & "F" table in "sheet2" by selecting the date in column "B".

    once i click on the table on the active sheet ( because i have many worksheet on the workbook ), then pop up box should appear for input value to enter for column heading "C" & "F" by selecting the date in pop up box automatically value should go on the particular row on table only and if value entering has "zero" only it should not accept the value has zero it should be greater than zero only or it can be accept the value instead of "zero" to enter has " N/A" (because to eliminate zero value for the chart).

    then i need also to protect my entire table and sheet and particular cells which is in yellow on column " D15 , D16 & F 12" the other user can be access only on the particular cells because if protect this sheet and another "sheet7" the pivot table i can't be refresh its getting msg has " you cant edit pivot table on protected sheet".

    pls guys help to solve this problems...
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: input box and lock the table and particular cells to user can acess

    I am having a bit of a problem interpreting the requirement, but I think this is what you want to do. Put this code on the sheet module for sheet 2

    rivate Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim ColC_Value As Variant
    Dim ColF_Value As Variant
    Dim RowNum As Long
    
    If Intersect(Target, Range("Table2[Date]")) Is Nothing Then Exit Sub
    
    RowNum = Target.Row
    
    ' Unprotect Sheet
    ActiveSheet.Unprotect Password:="Password"
    
    ' Get values
    ColC_Value = InputBox("Enter Column C Value", "Column C Value")
    ColF_Value = InputBox("Enter Column F Value", "Column F Value")
    
    ' Put values in cells
    Cells(RowNum, "C") = ColC_Value
    Cells(RowNum, "F") = ColF_Value
    
    ' Protect Sheet
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="Password"
    End Sub
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: input box and lock the table and particular cells to user can acess

    hi

    thanks for the code but there was a some problem after running the code.

    1. After entering the value in the cell the sheet is protected but after that i need to use the filter months on the "F12" its saying i need to unprotect the sheet and enter password .

    2. also i have a chart on this same sheet 2 that i cant do filtering.

    3.after i close and open the file its says " u cant edit the pivot table on protected sheet"

    this sheet going to use other users so i dont want to give password to unprotect the sheet for filtering the months and charts.

    All ur work code is nice only thing this steps works fine then my problems will be solve try for me pls...

  4. #4
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: input box and lock the table and particular cells to user can acess

    hi,

    again i updated the new worksheet for clear visual to understand the error pls check the attached file.

    all the user will work to edit on the "F12" and column "C & d" and the filtering option of the chart so according to that acces to free from others to edit.
    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. Lock cells after input and after entering value
    By Medicius in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2015, 03:13 AM
  2. lock spreadsheet so user can only input certain fields and print
    By cobrien64 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2015, 04:39 AM
  3. lock specific cells in table but allow user to add rows
    By BrotherNeptune in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2015, 01:15 PM
  4. Cells lock after user input - based on data
    By francis.rizzo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-12-2012, 09:55 AM
  5. Lock cells in a row after input
    By nanogr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2011, 06:07 PM
  6. Protect/lock cells after user input
    By pprseller in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-12-2009, 08:46 PM
  7. [SOLVED] Lock out manual input to cells?
    By Jon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2005, 05: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