Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Export()
- '
- ' Export Macro
- ' Export Rules and Privileges to 'Rules.csv' and Privileges.csv'
- '
- ' Keyboard Shortcut: Ctrl+Shift+E
- '
- Dim ws As Worksheet
- Dim path As String
- path = ActiveWorkbook.path & ""
- For Each ws In Worksheets
- If ws.Name Like "Rules" Then
- ws.Activate
- ws.SaveAs Filename:=path & "Rules.csv", FileFormat:=xlCSV, CreateBackup:=True
- End If
- If ws.Name Like "Privileges" Then
- ws.Activate
- ws.SaveAs Filename:=path & "Privileges.csv", FileFormat:=xlCSV, CreateBackup:=True
- End If
- Next
- Range("B9").Select
- Application.Run "RulesWorkbook.xlsm!Export"
- Range("B4").Select
- End Sub
- Sub Export()
- '
- ' Export Macro
- ' Export SecurityRules and Privileges to 'Rules.csv' and 'Privileges.csv'
- '
- ' Keyboard Shortcut: Ctrl+Shift+E
- '
- Dim ws As Worksheet
- Dim path As String
- path = ActiveWorkbook.path & ""
- For Each ws In Worksheets
- If ws.Name Like "Rules" Then
- ws.SaveAs Filename:=path & "Rules.csv", FileFormat:=xlCSV, CreateBackup:=True
- End If
- If ws.Name Like "Privileges" Then
- ws.SaveAs Filename:=path & "Privileges.csv", FileFormat:=xlCSV, CreateBackup:=True
- End If
- Next
- Application.DisplayAlerts = False
- ActiveWorkbook.Close
- Application.DisplayAlerts = True
- End Sub
Add Comment
Please, Sign In to add comment