Sub Divide()
Dim fPath As String
Dim fName As String
Dim wb As Workbook
Dim ws As Worksheet
Dim pwd As String
pwd = "can" ' Put your password here
'Setup
Application.ScreenUpdating = False
fPath = "C:\Documents and Settings\TRSECCAN\2011\Excel\" 'remember final \ in this string
fName = Dir(fPath & "*.xls") 'start a list of filenames
Do While Len(fName) > 0
Set wb = Workbooks.Open(fPath & fName) 'open found file
With ActiveSheet
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Locked = False
.Protect Password:=pwd
End With
wb.Close True 'close/save
fName = Dir 'get next filename
Loop
Application.ScreenUpdating = True
End Sub
I need a macro for Opening all the workbooks in a folder then for each sheet it will select blank cells, then make them unlocked then protect the sheet with a given password.
The upper code does this only for the active sheett, how can i make it for all the sheets the macro opens ? and Is there anyway i can deploy the below into the code
UpdateLinks:=xlUpdateLinksNever
Thanks in Advance
I have found the code to be useful so thanks everyone for contribution