Hi!
I have a question regarding the macro below. As you can see the macro loops trough a droplist and copy the sheet to a new one and saves it. My question is if it's possible to have the new sheets password protected? In my case I would like to have diffrent password for each file...
I'm getting Error 424 - Object Required, any idéa how to fix this one?
Sub Sammanfattning_Save()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Sheets("Sammanställning").Select
Dim rng As Range, cell As Range
Set rng = Evaluate(ActiveSheet.Range("G1").Validation.Formula1)
t = rng(1, 1).Row
For Each cell In rng
ActiveSheet.Range("G1").Value = cell.Value
Sheets("Sammanställning").Copy
Dim FName As String
Dim FPath As String
FPath = "C:\Users\Hemma\Documents\My Dropbox\Kristofer\Jobb\Sammanställningar"
FName = Sheets("Sammanställning").Range("G1").Text
ActiveSheet.SaveAs Filename:=FPath & "\" & FName, Password:=Sheets("Password").Range("A1").Offset(cl.Row - t, 0).Value, ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
I really hope you can help me with this one =)
Regards,
Christoffer
Bookmarks