move Sheet to New Workbook If Inputbox value = 1

hajiali

Well-known Member
Joined
Sep 8, 2018
Messages
626
Office Version
  1. 2016
Platform
  1. Windows
Using the Below CODE:

Code:
Sub Copy_Unprotect_SCHEDULE()Dim NewName As String
    NewName = InputBox("ENTER THE DAY OF MONTH THE NEW BID STARTS?")
    MsgBox "Importing data will take a few moments we will notify you once completed", vbOKOnly
    Sheets("SCHEDULE").Select
    Sheets("SCHEDULE").Copy After:=Worksheets(Worksheets.Count)
    Sheets("SCHEDULE (2)").Select
    Sheets("SCHEDULE (2)").Unprotect "PaperPushers"
    Sheets("SCHEDULE (2)").Tab.ColorIndex = 2
    Sheets("SCHEDULE (2)").name = "SCH" & " " & Format(Date, "mm") & "-" & NewName
    Range("K1") = " "
    Range("d1") = Format(Date, "mmm")
    Range("h1") = NewName
    Range("J1") = Format(Date, "YYYY")
    Call scheduleformulachange
[COLOR=#ff0000]    ActiveSheet.Move[/COLOR]
End Sub

I want to add an if Statement that IF the Result of NewName = 1 than ActiveSheet.Move and Rename the New Workbook to Format(Date, "mmm") & "Schedule" Same location as the Previous
Else
move the sheet to the same workbook AUG Schedule.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top