Blocarea celulelor dupa ce s-a introdus date in ele EXCEL
Last Updated: Apr 24 2017 13:56, Started by
ionita_adrian
, Mar 13 2017 13:49
·
0
#1
Posted 13 March 2017 - 13:49
salut,
am si eu un timesheet si as dori ca dupa ce acest timesheet e completat si salvat sa nu mai poata sa fie modificat. Am cautat pe net si am gasit ca se poate face doar cu vba dar nu stiu cum sa bag acest macro sa functioneze in excelul meu Codul de vba este acesta: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If ActiveSheet.Name = "Sheet1" Then On Error Resume Next 'Resume to next line if any error occurs Dim Cell As Range With ActiveSheet 'first of all unprotect the entire 'sheet and unlock all cells .Unprotect Password:="" .Cells.Locked = False 'Now search for non blank cells 'and lock them and unlock blank cells For Each Cell In ActiveSheet.UsedRange If Cell.Value = "" Then Cell.Locked = False Else Cell.Locked = True End If Next Cell .Protect Password:="" 'Protect with blank password, you can change it End With Exit Sub End If End Sub >>>>luat de la aceasta adresa http://www.ozgrid.co...ad.php?t=161591 iar aici si linkul catre excel https://app.box.com/...i1lgza2fbvxt75m Va rog sa ma ajutati |
#3
Posted 13 March 2017 - 18:18
rintintin, on 13 martie 2017 - 17:41, said:
protect sheet in excel Probabil e mai sigur ce spune initiatorul insa nu ma pricep asa bine. |
#4
Posted 21 March 2017 - 14:23
cu protect sheet trebuie sa intru eu mereu pe acest excel.. eu vreau sa il acesez doar atunci cand e nevoie in rest el dupa ce e salvat sa nu mai poata sa fie modificat de nimeni
|
#5
Posted 24 April 2017 - 13:29
gata am gasit o combinatie care merge asa cum mi-am dorit eu utilizatorul sa intre introduce datele si apoi nu mai poate sa modifice mai jos sunt pasi ce trebuie urmati se foloseste VBA
1. select all -> Ctr+1 -> Uncheck Locked 2. Alt+t+p+p to protect 3. Alt+t+p+p to unprotect 4. Select all -> ctrl+1 -> check box to Locked 5. Select a range of cells that you want to edit -> ctrl+1 -> uncheck Locked 6. Alt+t+p+p a. select sheet b. select Worksheet c. select Change d. delete all and copy code below ========= Private Sub Worksheet_Change(ByVal Target As Range) ActiveSheet.Unprotect Password:="pass" Target.Locked = True ActiveSheet.Protect Password:="pass" End Sub |
#6
Posted 24 April 2017 - 13:56
O chestie mai elaborata aici:
https://answers.micr...ee-dfa310e3e319 De asemenea, cu setarile de securitate default, la o noua deschidere a fisierului macros sunt disabled. Nu se poate modifica ce a fost scris anterior, dar se poate modifica tot ce e scris de la acel punct inainte. Si pe Excel si pe LibreOffice. Edited by bladhaund, 24 April 2017 - 13:53. |
Anunturi
Bun venit pe Forumul Softpedia!
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users