+ Reply to Thread
Results 1 to 29 of 29

Column Protect if Current Date is Passed

  1. #1
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Column Protect if Current Date is Passed

    Hi All,
    I have sheet where date are given in column from 1st day of month to last day of month like...01-01-2012.........01-31-2012
    what i acctualy want if the date is given in column A is less than current date then column A automaticaly protect and so on.....

    please help me out

    Thanks & Regards,
    Abdul
    Last edited by Abdul Haneef; 01-19-2012 at 09:59 AM.

  2. #2
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Please provide the VBA code below mention problem. It's a urgent.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Column Protect if Current Date is Passed

    Hi

    Do you need it only with VBA code?

    Because you can do it using Custom Validation, also.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hi
    Yes i need a VBA code

    because through validation person can not change the value but can be deleted. please help me.

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Column Protect if Current Date is Passed

    Sorry. My knowdledge in VBA, is very poor...

  6. #6
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Any body can help on this.

  7. #7
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Column Protect if Current Date is Passed

    Please post an example workbook and i'll take a look.

    Im not sure from your explanation if all the dates are populated in column A vertically or if they are in Row 1 and populated horizontally.

    Thanks
    McCrimmon

  8. #8
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hi,

    Dates are populated horizentally in row 1. what i want check if column B1 date is less then current date then column B locked, and then go to check column C1 date is less than current date then column c locked and so on...

    I am also attaching the format file.

    please provide the macro it's urgent.
    Attached Files Attached Files
    Last edited by Abdul Haneef; 01-14-2012 at 06:27 AM.

  9. #9
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Please provide the macro code.

  10. #10
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Column Protect if Current Date is Passed

    Hi

    Please be more patient when waiting for help.

    Thanks

    McC

    Please Login or Register  to view this content.
    PS - If this sorts your problem then please mark the thread as solved and feel free to add reputation if this meets your requirements.

  11. #11
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hi

    Thanks for your support.
    this code protect the whole sheet1. but i want only protect those column which date is less than current date. I will appriciate if you add the macro in excel file and send to me because i am new in excel.

    Thanks
    Abdul

  12. #12
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Column Protect if Current Date is Passed

    Please find attached:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Thanks a lot for quick reply

    This code is protect the column till 14 Jan its not working on 15th Jan column. i want when we open the file then all the previous date column are automatically protect. this will happen on daily basis.

    Thanks
    Abdul

  14. #14
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Column Protect if Current Date is Passed

    hi
    Abdul, the code provided by mccrimmon works fine for me! it's a great job! I use it! thx man!
    see the file attached.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  15. #15
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hi

    Thank you so much sir.. great job

    now my problem is solved.

    i don't know how to mark solved please mark as solved

  16. #16
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Column Protect if Current Date is Passed

    Abdul,
    see the forum rules
    or
    (...)
    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.

  17. #17
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hi,

    Yesterday i putt this code on original file. today when i opened the file it will not protected the yesterday date column. please look and suggest to me what i do.

    thanks
    Abdul

  18. #18
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hi,

    Yesterday i putt this code on original file. today when i opened the file it will not protected the yesterday date column. please look and suggest to me what i do.

    thanks
    Abdul

  19. #19
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Column Protect if Current Date is Passed

    hi Abdul
    as an option, try to change the pc date and see if it heps you
    Please Login or Register  to view this content.

  20. #20
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hi John,

    Now it is working properly. Thanks a lot......

    Thanks
    Abdul

  21. #21
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Column Protect if Current Date is Passed

    well, hope it works! glad I could help!

  22. #22
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    yes John it is working properly, but i have problem when i share the workbook and when open again then it's showing

    "run time error '1004'
    Unprotect method of worksheet class faild"

    I want a share workbook. because 4-5 people are working same time in this file. please provide some solution.

    Thnaks
    Abdul

  23. #23
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Column Protect if Current Date is Passed

    Abdul, I'd like to help you but regarding the sharing of the workbook I know nothing! I'm sorry!
    maybe someone else might help you!

  24. #24
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hello All

    please provide the help regard above mention issue.

  25. #25
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hi
    I find out the solution for sharing workbook now this code will run on share workbook.
    Please Login or Register  to view this content.
    Last edited by Abdul Haneef; 01-21-2012 at 02:13 PM.

  26. #26
    Registered User
    Join Date
    01-04-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Column Protect if Current Date is Passed

    Hi
    I find out the solution for sharing workbook now this code will run on share workbook.
    Please Login or Register  to view this content.

  27. #27
    Registered User
    Join Date
    06-13-2012
    Location
    bucharest
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Column Protect if Current Date is Passed

    I have the same problem like Abdul. Can someone help me with a code ?? I create a excel file and I want to lock automaticaly all the columns with date pasted. I put dates on row 1 (starting B1 to AN1). On cell A1 is current day. All columns with dates less then current date should be lock/protect. thanks in advance

    test1.xlsx

  28. #28
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Column Protect if Current Date is Passed

    Please start your own thread, petre. "Hijacking" of old threads is against the forum rules. See rule 2
    Audere est facere

  29. #29
    Registered User
    Join Date
    06-13-2012
    Location
    bucharest
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Column Protect if Current Date is Passed

    sorry, I didn't know. I'll start a new thread.

+ 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