I am new to VBA coding
I am trying to write a code to copy data from on sheet to another by searching and for that I am using recursion And the code looks something like this
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
My issue here is when it comes to the call macro it starts from the first and then check for while condition and when the while condition is not met it should come out end the sub but it doesn't after end sub its again going back to end if.can someone help me with this
EDIT
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