发布网友
共1个回答
热心网友
摘要Sub 下载钉钉导出数据中的图片()Dim i As IntegerDim sFileName, sUrl As StringDim arr() As StringDim arrCol() As StringOn Error Resume NextDim sKey, sDownS, sDown As StringDim iLine As IntegersKey = InputBox("请输入需要建目录的关键列号(请输入列号的字母)")sDownS = InputBox("请输入需要下载图片的列号(输入多个要下载的列号的字母,如果多列请用半角分号分隔开)")iLine = Int(InputBox("请输入您指定开始下载的行号(只能输入数字)"))If iLine <= 2 Then iLine = 2Dim PathSht As StringWith Application.FileDialog(msoFileDialogFolderPicker) If .Show Then PathSht = .SelectedItems(1) Else Exit Sub '如果没有选择路径则退出End WithPathSht = PathSht & ""For i = iLine To Range("A" & Rows.Count).End(xlUp).Row MkDir (PathSht & Range(sKey & i)) '建立一个文件夹 Dim m As Integer arrCol = Split(sDownS, ";") '判断是不是有多列需要下载 For m = 0 To UBound(arrCol) sDown = arrCol(m) Dim j As Integer arr = Split(Range(sDown & i), Chr(10)) '钉钉中特有的,如果有多张图片,钉钉中会使用分割符分割 Dim jj As Integer jj = 0 For j = 0 To UBound(arr) If arr(j) > "" Then jj = jj + 1 sFile咨询记录 · 回答于2021-10-09钉钉里面,导出Excel中图片如何一起导出Sub 下载钉钉导出数据中的图片()Dim i As IntegerDim sFileName, sUrl As StringDim arr() As StringDim arrCol() As StringOn Error Resume NextDim sKey, sDownS, sDown As StringDim iLine As IntegersKey = InputBox("请输入需要建目录的关键列号(请输入列号的字母)")sDownS = InputBox("请输入需要下载图片的列号(输入多个要下载的列号的字母,如果多列请用半角分号分隔开)")iLine = Int(InputBox("请输入您指定开始下载的行号(只能输入数字)"))If iLine <= 2 Then iLine = 2Dim PathSht As StringWith Application.FileDialog(msoFileDialogFolderPicker) If .Show Then PathSht = .SelectedItems(1) Else Exit Sub '如果没有选择路径则退出End WithPathSht = PathSht & ""For i = iLine To Range("A" & Rows.Count).End(xlUp).Row MkDir (PathSht & Range(sKey & i)) '建立一个文件夹 Dim m As Integer arrCol = Split(sDownS, ";") '判断是不是有多列需要下载 For m = 0 To UBound(arrCol) sDown = arrCol(m) Dim j As Integer arr = Split(Range(sDown & i), Chr(10)) '钉钉中特有的,如果有多张图片,钉钉中会使用分割符分割 Dim jj As Integer jj = 0 For j = 0 To UBound(arr) If arr(j) > "" Then jj = jj + 1 sFile