用循环嵌套进行 就可以,下图的是 4列的宏代码
Sub a()
Dim a, b, c, d As Integer
a = Sheets(1).[a65536].End(xlUp).Row
b = Sheets(1).[b65536].End(xlUp).Row
c = Sheets(1).[c65536].End(xlUp).Row
d = Sheets(1).[d65536].End(xlUp).Row
For i = 1 To a
For p = 1 To b
For q = 1 To c
For t = 1 To d
x = x + 1
Cells(x, 7).Value = Cells(i, 1).Value &Cells(p, 2).Value &Cells(q, 3).Value &Cells(t, 4).Value
Next
Next
Next
Next
End Sub
Public Function UrlDecode(ByVal strText As String) As String '如果值中带有非英文和数字,则需转换成%形式'url编码 utf-8
Dim js
Set js = CreateObject("msscriptcontrol.scriptcontrol")
js.Language = "JavaScript"
'UrlDecode = js.eval("decodeURI('" &strText &"')") '忽略! @ # $&* ( ) = : / + '
'UrlEncode = js.Eval("escape('" &Replace(strText, "'", "\'") &"')") '汉字转换为%u开头的Unicode码 不会被此方法编码的字符: @ * / +
UrlDecode = js.Eval("decodeURIComponent('" &strText &"')") '包含://
End Function
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)