I have a sheet named say "A". I have to create a duplicate sheet in the same workbook and rename it as "B" which can be done as
<Code>
Sheets("A").Copy After:=Sheets(1)
Sheets("A (2)").Name = "B"
</code>
But the problem is I want to create this new sheet "B" immediately after "A" where the position of "A" can be anything. It can be the 1st sheet or 2nd or anything else. But sheet "B" should be created just after sheet "A".
<Code>
Sheets("A").Copy After:=Sheets(1)
Sheets("A (2)").Name = "B"
</code>
But the problem is I want to create this new sheet "B" immediately after "A" where the position of "A" can be anything. It can be the 1st sheet or 2nd or anything else. But sheet "B" should be created just after sheet "A".