EXCEL VBA移动内容到指定范围空单元处
P26:Z39为区域1的范围2.A18:K37为区域2的范围3.将区域1的内容移动到区域24.列对列接着区域2内容...
P26:Z39为区域1的范围
2.A18:K37为区域2的范围
3.将区域1的内容移动到区域2
4.列对列接着区域2内容 展开
2.A18:K37为区域2的范围
3.将区域1的内容移动到区域2
4.列对列接着区域2内容 展开
1个回答
展开全部
Sub s()
Dim rg1 As Range, rg2 As Range
Set rg1 = [p26: z39]
Set rg2 = [a18: k37]
For i = 1 To rg1.Columns.Count
j = 1
While rg2.Cells(j, i) <> ""
j = j + 1
Wend
k = 1
While rg1.Cells(k, i) <> ""
rg2.Cells(j, i) = rg1.Cells(k, i)
j = j + 1
k = k + 1
Wend
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询