+ Reply to Thread
Results 1 to 4 of 4

Custom Cell Range Code

  1. #1
    Registered User
    Join Date
    08-27-2018
    Location
    London
    MS-Off Ver
    office 2016
    Posts
    45

    Custom Cell Range Code

    Can you please help fix the clear button in SetUp as currently it is throwing an error

    Sub Rectangle3_Click()

    With Sheets("£SAFE LOG")
    .Unprotect Password:="cream"
    With .Range("B9:H9, B12:H12, B19:H19, B21:h21, B31:H31")
    .ClearContents
    .Locked = False
    End With
    End With
    End Sub

    The code in the SafeLog sheet is specifically to prevent false cell locks, in cases of empty inputs like pressing the delete key when the cell is selected

    the clear button needs to work without changing the code under safe log

    or

    the code under safe log can change to make the clear button work without reintroducing the false cell lock issue

    Thank you
    Attached Files Attached Files
    Last edited by diddy47; 05-02-2019 at 04:07 PM.

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

    Re: Custom Cell Range Code

    I don't know if this is what you want, but wrapping the code in enablevents runs the code without error.

    Please Login or Register  to view this content.
    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
    Registered User
    Join Date
    08-27-2018
    Location
    London
    MS-Off Ver
    office 2016
    Posts
    45

    Re: Custom Cell Range Code

    Quote Originally Posted by dflak View Post
    I don't know if this is what you want, but wrapping the code in enablevents runs the code without error.

    Please Login or Register  to view this content.
    Hello

    I tried, the new code it works ok in clearing the cell range however the code in the safe log sheet does not work anymore, the cells do not lock after input anymore, anyway to rectify or reverse this?

    thanks

  4. #4
    Registered User
    Join Date
    08-27-2018
    Location
    London
    MS-Off Ver
    office 2016
    Posts
    45

    Re: Custom Cell Range Code

    my mistake the code works perfectly somehow all vba scripts had been turned off had to turn them back on using

    Open the VBA window (press ALT+F11)

    Click View -> Immediate Window


    Application.EnableEvents = True
    and press enter.

+ 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. Washout Background Image by Custom Cell Range
    By davo3286 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2019, 01:07 PM
  2. [SOLVED] Apply Conditional Formatting to Custom Range if Cell Value Outside Range is ____
    By eNinjaInTraining in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-07-2019, 04:09 PM
  3. [SOLVED] Creating a custom dropdown list without using code or cell reference
    By ysdai7287 in forum Excel General
    Replies: 2
    Last Post: 05-30-2018, 09:23 AM
  4. Help with Referencing a Cell Relative to Active Cell in Custom Function Code
    By mjjb99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2016, 09:33 PM
  5. [SOLVED] Very Custom Conditional Formatting with cell range, Help!
    By radian89 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-01-2015, 05:43 AM
  6. Replies: 2
    Last Post: 12-11-2014, 03:26 PM
  7. Custom Function locking up other code for cell coloring
    By juskojj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2012, 04:21 PM

Tags for this Thread

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