Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 07-29-2024, 05:13 AM
p45cal's Avatar
p45cal p45cal is offline Vba to lock cells with formula in a table Windows 10 Vba to lock cells with formula in a table Office 2021
Expert
 
Join Date: Apr 2014
Posts: 962
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

This will work regardless of which sheet you're on as long as the workbook you want it to work in is the active workbook:
Code:
Sub ProtectFormulaCellsInTable_tAbstract()
With Range("tAbstract")
  .Parent.Unprotect
  .SpecialCells(xlCellTypeFormulas).Locked = True
  .Parent.Protect
End With
End Sub
Changing the message when someone tries to change a locked cell on a protected sheet is not possible (afaik) but something else can be done, see:
custom error message in popup window for protected cell? | MrExcel Message Board


…but is it worth it?
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Table Help: lock table structure and collapse/expand parts of table bsafra1 Word 0 11-06-2018 03:01 AM
Lock items in a table village Word 2 06-22-2017 07:33 AM
Lock Linked Cells And Unlinked Cells In A Row paulkaye Excel 5 07-14-2014 10:20 PM
Vba to lock cells with formula in a table How to lock only some cells in 2010 ? spookiepower Word 4 11-26-2013 02:40 PM
Protect / Lock Cells / Print Set-up? meggenm Excel 3 01-26-2012 09:57 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:36 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft