Hi, I have a sheet with a VBA Code that has a code to activate different Sheet reference and a code coming back to original sheet.
Sample: the button containing this code is in "Sheet 1" , upon clicking it needs to go to 'sheet 2' to modify something then go back to 'sheet 1'
now sometimes i need to duplicate Sheet 1, to a new sheet within same workbook. The problem is the code reference that it will copy will remain on "sheet 1" instead of supposedly "sheet 1 (1)"
How to code it that it will comeback to the original activated worksheet?
and another one, is there a code where for example when clicking a button to copy the sheet it will prompt a box that can enter the name of the sheet, and referencing that input in the code aswell?
Sample: the button containing this code is in "Sheet 1" , upon clicking it needs to go to 'sheet 2' to modify something then go back to 'sheet 1'
VBA Code:
ActiveWorkbook.Sheets("Sheet 2").Activate
Sheets("Sheet 2").Range("A1").Select
Selection.Copy
Sheets("INPUT").Range("P7:P1000").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Sheet 1").Select
Range("G4").Select
now sometimes i need to duplicate Sheet 1, to a new sheet within same workbook. The problem is the code reference that it will copy will remain on "sheet 1" instead of supposedly "sheet 1 (1)"
How to code it that it will comeback to the original activated worksheet?
and another one, is there a code where for example when clicking a button to copy the sheet it will prompt a box that can enter the name of the sheet, and referencing that input in the code aswell?