Hello Everyone,
I am trying to create a VBA Code to copy an active worksheet into a new work sheet. But I am not able to do so, I have tried different syntax for the same but nothing works. Basically, I got a code from google, that works very well with copying a sheet completely, but can't get the activesheet into it. Please help. I am a new born baby as far as VBA is concerned.
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit;">Sub CreateNewSheet()dim sName as stringSheets("24 April").copy after:=activesheetsname=inputbox("Enter new sheet name")on error resume nextactivesheet.name=snameif err<>0 then msgbox "Name not valid"err.clearon error goto 0End Sub</code></pre>
I am trying to create a VBA Code to copy an active worksheet into a new work sheet. But I am not able to do so, I have tried different syntax for the same but nothing works. Basically, I got a code from google, that works very well with copying a sheet completely, but can't get the activesheet into it. Please help. I am a new born baby as far as VBA is concerned.
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit;">Sub CreateNewSheet()dim sName as stringSheets("24 April").copy after:=activesheetsname=inputbox("Enter new sheet name")on error resume nextactivesheet.name=snameif err<>0 then msgbox "Name not valid"err.clearon error goto 0End Sub</code></pre>