new

Excel

EXCELમાં બધી શીટ એકસાથે પ્રોટેક્ટ કે અનપ્રોટેક્ટ કરવી


Excelમાં બધી શીટ એકસાથે પ્રોટેક્ટ કે અનપ્રોટેક્ટ કરવી
Excelનો ઉપયોગ કરતી વખતે આપણે ફોર્મ્યૂલા અને લિંકને બચાવવા માટે શીટ પ્રોટેક્ટ કરતા હોઇએ છીએ. જ્યારે ફાઇલમાં ઘણી બધી શીટ હોય ત્યારે સુધારા કરતી વખતે વારંવાર શીટને પ્રોટેક્ટ અને અનપ્રોટેક્ટ કરવી પડતી હોય છે. આ પ્રક્રિયાને ઝડપી બનાવવા અહિં એકસાથે બધી શીટને પ્રોટેક્ટ અને અનપ્રોટેક્ટ કરવાની રીત બતાવેલ છે.


Code:
                      
Option Explicit

Sub ProtectAll()
    
    Dim wSheet          As Worksheet
    Dim Pwd             As String
    
    Pwd = InputBox("Enter your password to protect all worksheets", "Password Input")
    For Each wSheet In Worksheets
        wSheet.Protect Password:=Pwd
    Next wSheet
    
End Sub

Sub UnProtectAll()
    
    Dim wSheet          As Worksheet
    Dim Pwd             As String
    
    Pwd = InputBox("Enter your password to unprotect all worksheets", "Password Input")
    On Error Resume Next
    For Each wSheet In Worksheets
        wSheet.Unprotect Password:=Pwd
    Next wSheet
    If Err <> 0 Then
        MsgBox "You have entered an incorect password. All worksheets could not " & _
        "be unprotected.", vbCritical, "Incorect Password"
    End If
    On Error Goto 0
    
End Sub

                      
ઉપયોગની રીત:
  1. ઉપરનો Code કોપી કરો.
  2. MS Excel ઓપન કરો.
  3. Alt + F11 દબાવી Visual Basic Editor (VBE) ઓપન કરો.
  4. Insert મેનુમાંથી Module સિલેક્ટ કરી ઉમેરો.
  5. જમણી બાજુની વિન્ડોમાં કોડ પેસ્ટ કરો.
  6. VBE બંધ કરો.
  7. Save As ક્લિક કરી ફાઇલને Excel Macro-Enabled Workbook તરીકે Save કરો.
  8. હવે જ્યારે બધી શીટ પ્રોટેક્ટ કરવી હોય ત્યારે View મેનુમાંથી Macros પર ક્લિક કરો.ProtectAll કે UnProtectAll પર ડબલ ક્લિક કરતા બધી શીટમાં એકસાથે પ્રક્રિયા થશે.
Microsoft Excel

                     Is a spreadsheet application developed by Microsoft for Microsoft Windows and Mac OS X. It features calculation, graphing tools, pivot tables, and a macro programming language called Visual Basic for Applications. It has been a very widely applied spreadsheet for these platforms, especially since version 5 in 1993, and it has replaced Lotus 1-2-3 as the industry standard for spreadsheets. 

How to easily learn  Microsoft Excel
 I will give you all the formula of Excel  please click on image