【发布时间】:2023-03-23 18:15:01
【问题描述】:
我有两个专栏,国家和商业。每个国家/地区可能有 4 种业务类型(采矿、货运、航运、飞行),每个国家/地区至少有一种业务,例如
Country | Business
---------------------
England mining
England trucking
Spain mining
Germany mining
Germany trucking
Germany shipping
Germany flights
我有大约 170 多个国家/地区的文件夹。我需要在每个国家/地区为其拥有的特定业务创建文件夹。我的路径有问题。这是代码的一部分。我朝着正确的方向前进吗?
Dim z As Integer
Dim row,col,c As String
ActiveSheet.Range("A2").Select
For row = 2 To maxrows
col = 2
z = col + 1
c = Cells(row, col)
If Len(dir("C:\Users\patelwa\Documents\macr\& c &" & Cells(row, z), vbDirectory)) = 0 Then
MkDir ("C:\Users\patelwa\Documents\macr\& c &" & Cells(row, z))
On Error Resume Next
End If
Next row
【问题讨论】: