SlideShare a Scribd company logo
CODE FOR PROTECTING & UNPROTECTING
SHEET
Sub Protect_sheet()
Dim mypassword As String
mypassword = “Insert_Password"
Sheet1.Protect Password:=mypassword
End Sub
CODE TO PROTECT SHEET
CODE TO UNPROTECT SHEET
Sub UnProtect_sheet()
Dim mypassword As String
mypassword = “Insert_Password"
Sheet1.Unprotect Password:=mypassword
End Sub
CODE TO UNPROTECT SHEET
THANKYOU
CODE TO OPEN MULTIPLE FILES FROM A
FOLDER
Sub multiple_file_path()
Dim fso As FileSystemObject
Dim fl As File
Dim fldr As Scripting.Folder
Dim fls As files
Dim fldrscripting As Folder
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.GetFolder("C:Documents and SettingsWELCOMEDesktopNew Folder")
Set fls = fldr.files
For Each fl In fls
MsgBox (fl.Name)
Workbooks.Open fldr & "" & fl.Name
Next fl
End Sub
CODE TO OPEN MULTIPLE FILES FROM A
FOLDER
THANKYOU
CODE FOR ZOOM IN & ZOOM OUT
Sub MyZoomIn()
Dim ZP As Integer
ZP = Int(ActiveWindow.Zoom * 1.1)
If ZP > 400 Then ZP = 400
ActiveWindow.Zoom = ZP
End Sub
CODE FOR ZOOM IN
CODE FOR ZOOM OUT
And then Allocate Shortcut key to it.
Sub MyZoomOut()
Dim ZP As Integer
ZP = Int(ActiveWindow.Zoom * 0.9)
If ZP < 10 Then ZP = 10
ActiveWindow.Zoom = ZP
End Sub
CODE FOR ZOOM OUT
THANK YOU
And then Allocate Shortcut key to it.
CODE TO COLOR INTERIOR OF CELL
Sub Color_Interior_Cell()
ActiveCell.Interior.ColorIndex = 36
End Sub
CODE TO COLOR INTERIOR OF CELL
THANK YOU
Sub Color_Interior_Cell()
Range("A1:A6").Interior.Color = RGB(200,160,35)
End Sub
OR

More Related Content

PDF
Php file handling in Hindi
PDF
PPTX
Linux basic1&amp;2
PPTX
File upload for the 21st century
PDF
Swift 4 : Codable
PPTX
Php File Operations
PDF
与 PHP 和 Perl 使用 MySQL 数据库
Php file handling in Hindi
Linux basic1&amp;2
File upload for the 21st century
Swift 4 : Codable
Php File Operations
与 PHP 和 Perl 使用 MySQL 数据库

What's hot (19)

PPT
PHP - Introduction to File Handling with PHP
PPT
php file uploading
PPT
PPTX
33 meta
PPTX
Python data file handling
PDF
Can I write to a read only file ?
PPTX
R- create a table from a list of files.... before webmining
PDF
Find & Locate utility Linux
PPTX
My_sql_with_php
DOCX
Php files
PPTX
Sessions and cookies in php
PDF
TDC São Paulo 2016 - Become a jedi with php streams
PDF
scdevsumit 2016 - Become a jedi with php streams
PPTX
Unix cmd on_free_bsd
PDF
RESTing with the new Yandex.Disk API, Clemens Аuer
PDF
Mac OS X Lion で作る WordPress local 環境
PPT
Files and Directories in PHP
PDF
JSOP in 60 seconds
PHP - Introduction to File Handling with PHP
php file uploading
33 meta
Python data file handling
Can I write to a read only file ?
R- create a table from a list of files.... before webmining
Find & Locate utility Linux
My_sql_with_php
Php files
Sessions and cookies in php
TDC São Paulo 2016 - Become a jedi with php streams
scdevsumit 2016 - Become a jedi with php streams
Unix cmd on_free_bsd
RESTing with the new Yandex.Disk API, Clemens Аuer
Mac OS X Lion で作る WordPress local 環境
Files and Directories in PHP
JSOP in 60 seconds
Ad

Similar to Macros code for Protecting and Unprotecting Sheets (20)

DOCX
Ktifkan dulu microsoft visual basic
PPTX
Macros code Copy paste visible data after filtering
PDF
Forgot password for protected sheet on Microsoft Excel!?
PPTX
Excel Objective 1: Creating and Manipulating Data
DOC
Formatting and Layout excerpt
PDF
Kofi nyanteng excel notes
PDF
Kofi nyanteng excel notes
DOCX
Cara membuka workbook yang terproteksi
PPTX
Excel review and view tab
PPTX
Microsoft excel power point presentation.pptx
PPTX
Macros for Workbook
PDF
How to unprotect an excel sheet without password
PDF
Sachin Foujdar , BCA Third Year
PDF
Coaching Corps Excel User Manual
XLS
Excel shortcut keys
PDF
Bhanu Pratap Singh Shekhawat, BCA Third Year
PPT
Excel tips
PDF
Kirti Kumawat, BCA Third Year
PPTX
Lesson13 Working With Worksheets
PPTX
share workbook in computer
Ktifkan dulu microsoft visual basic
Macros code Copy paste visible data after filtering
Forgot password for protected sheet on Microsoft Excel!?
Excel Objective 1: Creating and Manipulating Data
Formatting and Layout excerpt
Kofi nyanteng excel notes
Kofi nyanteng excel notes
Cara membuka workbook yang terproteksi
Excel review and view tab
Microsoft excel power point presentation.pptx
Macros for Workbook
How to unprotect an excel sheet without password
Sachin Foujdar , BCA Third Year
Coaching Corps Excel User Manual
Excel shortcut keys
Bhanu Pratap Singh Shekhawat, BCA Third Year
Excel tips
Kirti Kumawat, BCA Third Year
Lesson13 Working With Worksheets
share workbook in computer
Ad

More from Pramodkumar Jha (20)

PPTX
R programming
PPTX
Macros for Border, Weight Clear Data
PPTX
Macros code For Loop
PPTX
Macros code for Font, Style, Size, Bold
PPTX
Macros for Shape and formula
PPTX
Macros for Workbook
PPTX
Macros to Copy Paste
PPTX
Non-Verbal communication language
PPT
Letters presentation
PPT
E mails presentation
PPT
Communication
PPT
Communication across cultures
PPT
Body language
PPT
Barriers to communication
PPT
Business intelligence
PPTX
PPT
Financial ratios analysis
PPTX
Financial concept (part ii)
PPTX
Financial concept (part i)
PPTX
Cost of capital
R programming
Macros for Border, Weight Clear Data
Macros code For Loop
Macros code for Font, Style, Size, Bold
Macros for Shape and formula
Macros for Workbook
Macros to Copy Paste
Non-Verbal communication language
Letters presentation
E mails presentation
Communication
Communication across cultures
Body language
Barriers to communication
Business intelligence
Financial ratios analysis
Financial concept (part ii)
Financial concept (part i)
Cost of capital

Recently uploaded (20)

PPT
ISS -ESG Data flows What is ESG and HowHow
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
Introduction to machine learning and Linear Models
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PDF
Mega Projects Data Mega Projects Data
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PDF
Lecture1 pattern recognition............
PPTX
Introduction to Knowledge Engineering Part 1
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
Business Analytics and business intelligence.pdf
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PDF
Foundation of Data Science unit number two notes
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
ISS -ESG Data flows What is ESG and HowHow
Fluorescence-microscope_Botany_detailed content
Supervised vs unsupervised machine learning algorithms
Introduction to machine learning and Linear Models
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Mega Projects Data Mega Projects Data
Introduction-to-Cloud-ComputingFinal.pptx
Galatica Smart Energy Infrastructure Startup Pitch Deck
Lecture1 pattern recognition............
Introduction to Knowledge Engineering Part 1
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Business Analytics and business intelligence.pdf
Miokarditis (Inflamasi pada Otot Jantung)
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
Foundation of Data Science unit number two notes
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Acceptance and paychological effects of mandatory extra coach I classes.pptx

Macros code for Protecting and Unprotecting Sheets

  • 1. CODE FOR PROTECTING & UNPROTECTING SHEET
  • 2. Sub Protect_sheet() Dim mypassword As String mypassword = “Insert_Password" Sheet1.Protect Password:=mypassword End Sub CODE TO PROTECT SHEET CODE TO UNPROTECT SHEET
  • 3. Sub UnProtect_sheet() Dim mypassword As String mypassword = “Insert_Password" Sheet1.Unprotect Password:=mypassword End Sub CODE TO UNPROTECT SHEET THANKYOU
  • 4. CODE TO OPEN MULTIPLE FILES FROM A FOLDER
  • 5. Sub multiple_file_path() Dim fso As FileSystemObject Dim fl As File Dim fldr As Scripting.Folder Dim fls As files Dim fldrscripting As Folder Set fso = CreateObject("Scripting.FileSystemObject") Set fldr = fso.GetFolder("C:Documents and SettingsWELCOMEDesktopNew Folder") Set fls = fldr.files For Each fl In fls MsgBox (fl.Name) Workbooks.Open fldr & "" & fl.Name Next fl End Sub CODE TO OPEN MULTIPLE FILES FROM A FOLDER THANKYOU
  • 6. CODE FOR ZOOM IN & ZOOM OUT
  • 7. Sub MyZoomIn() Dim ZP As Integer ZP = Int(ActiveWindow.Zoom * 1.1) If ZP > 400 Then ZP = 400 ActiveWindow.Zoom = ZP End Sub CODE FOR ZOOM IN CODE FOR ZOOM OUT And then Allocate Shortcut key to it.
  • 8. Sub MyZoomOut() Dim ZP As Integer ZP = Int(ActiveWindow.Zoom * 0.9) If ZP < 10 Then ZP = 10 ActiveWindow.Zoom = ZP End Sub CODE FOR ZOOM OUT THANK YOU And then Allocate Shortcut key to it.
  • 9. CODE TO COLOR INTERIOR OF CELL
  • 10. Sub Color_Interior_Cell() ActiveCell.Interior.ColorIndex = 36 End Sub CODE TO COLOR INTERIOR OF CELL THANK YOU Sub Color_Interior_Cell() Range("A1:A6").Interior.Color = RGB(200,160,35) End Sub OR