VBA管理filezilla 之用户组及共享目录权限批量代码
EXCEL VBA管理filezilla 之用户组及共享目录权限批量代码_第1张图片原文地址
表格数据

VBA模块代码:


Option Explicit
Dim str, xmlfile As String
Dim i As Integer

Sub xiegroups()
Dim GROUPS
Set GROUPS = Sheets("GROUPS")

'用户组信息开始写入
str = " "
Call xiexml(str)

For i = 2 To GROUPS.Range("A65535").End(xlUp).Row
'判断如果是用户组的第一行

If GROUPS.Range("B" & i) = 1 Then
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = "
"
Call xiexml(str)
str = " "
Call xiexml(str)
End If

'目录及权限设置

str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = "
"
Call xiexml(str)
'判断是否用户组的最后一行

If GROUPS.Range("B" & i) = Application.WorksheetFunction.CountIf(GROUPS.Range("A:A"), GROUPS.Range("A" & i)) Then
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = "
"
Call xiexml(str)
str = " "
Call xiexml(str)
End If
Next

'用户组信息写入结束
str = " "
Call xiexml(str)

End Sub

Sub xiexml(AnyString)
xmlfile = "G:\11\filezilla.xml"
Open xmlfile For Append As #1
Print #1, str
Close #1
End Sub

输出效果
EXCEL VBA管理filezilla 之用户组及共享目录权限批量代码_第2张图片
EXCEL VBA管理filezilla 之用户组及共享目录权限批量代码_第3张图片

视频教程正在录制中,我的网络课堂:https://edu.51cto.com/lecturer/6969164.html

管理用户:
Sub xieusers()

Dim USERS
Set USERS = Sheets("USERS")

'用户信息开始写入
str = " "
Call xiexml(str)

For i = 2 To USERS.Range("A65535").End(xlUp).Row

str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = "
"
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = " "
Call xiexml(str)
str = "
"
Call xiexml(str)
str = "
"
Call xiexml(str)

Next

'用户信息写入结束
str = " "
Call xiexml(str)
str = ""
Call xiexml(str)

End Sub