我是VBA编码新手
我正在尝试编写一个代码,通过搜索将数据从工作表复制到另一个,并且我正在使用递归 代码看起来像这样
Sub macro()
While s <> ""
Here comes copying each line and moving to the other page and searching for which row to post it on
After pasting
Call macro and then there is
end if
And wend
End sub
我的问题是,当涉及调用宏时,它从第一个开始,然后检查while条件,当while条件不满足时,它应该结束sub但是它不会在结束后再次它回到最后if.can有人帮助我这个
修改
Sub macro()
dim issue as string
dim i as integer
sheets(age).activate
while s <> "value"
activecell.offset(1,0)
Issue = active cell.value
ActiveCell.Offset(, 1).Resize(1, 5).Copy
sheets(age1).activate
range(A1).select
for I =1 to 12
if active cell = issue activecell.offset(0,1) Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False
call macro
end if
Next i
wend
end sub