VBA Copy a worksheet

Опубликовано: 27 Октябрь 2024
на канале: Simplified Excellence
170
0

Copy an entire worksheet with one command!

Code:
Sub copy_sheet()

'copy a sheet to somewhere else

Dim ws_sheet_to_copy As Worksheet
Dim ws_sheet_neutral As Worksheet

'identify sheets
Set ws_sheet_to_copy = Worksheets(1)
Set ws_sheet_neutral = Worksheets(2)

'copy sheet after the other one
ws_sheet_to_copy.Copy after:=ws_sheet_neutral

'copy sheet before the other one
ws_sheet_to_copy.Copy before:=ws_sheet_neutral

End Sub

-------------------------------
NEED HELP?
-------------------------------
Leave a comment with your questions, issues or projetcs and I will try to answer with a video.

-------------------------------
THANK YOU
-------------------------------
For watching my videos,
Your shares
And your comments!