+ Reply to Thread
Results 1 to 3 of 3

Macro to create name sheet using an input box with default text in sheet name

  1. #1
    Registered User
    Join Date
    11-30-2018
    Location
    London
    MS-Off Ver
    2016
    Posts
    5

    Macro to create name sheet using an input box with default text in sheet name

    hi all!

    i've tried to find a solution to this problem online for a while now but haven't been able to do so, so was hoping someone can help!

    i've created the following macro below which duplicates a template sheet, and comes up with an input box to prompt the user to name the sheet. what i would like to add is the default text "CAI" to every duplicated sheet so the user only has to insert a number.


    Sub Copy_CAI_Template()

    Dim Actsheet As String
    Application.ScreenUpdating = False
    On Error Resume Next
    ActiveWorkbook.Sheets("CAI Template").Visible = True
    ActiveWorkbook.Sheets("CAI Template").Copy _
    After:=Sheets(Sheets.Count)
    ActNm = ActiveSheet.Name
    ActiveSheet.Name = InputBox("Enter new CAI reference number")
    Sheets(ActiveSheet.Name).Visible = True
    ActiveWorkbook.Sheets("CAI Template").Visible = False
    Application.ScreenUpdating = True
    End Sub


    i would appreciate any help!

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,966

    Re: Macro to create name sheet using an input box with default text in sheet name

    You can add it in the code like this:

    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    11-30-2018
    Location
    London
    MS-Off Ver
    2016
    Posts
    5

    Re: Macro to create name sheet using an input box with default text in sheet name

    Quote Originally Posted by rorya View Post
    You can add it in the code like this:

    Please Login or Register  to view this content.
    thank you, worked perfectly!

    rep added!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to Re-format from Input sheet to Formatted sheet with Macro
    By theglitch in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2018, 03:14 PM
  2. macro to get sum of sheet 1 subtract with sum of sheet 2 and input value of sheet 3
    By danwoltrs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-15-2015, 04:41 PM
  3. [SOLVED] Issue regarding recorded Macro to transfer data from Input sheet to Storage sheet
    By Hirad001 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-29-2015, 04:26 PM
  4. Macro: Create an input sheet an copy the data onto a new row in another sheet
    By bernardnoel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2013, 09:23 AM
  5. [SOLVED] Particular data taken out form input sheet to desire sheet by macro
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-23-2013, 01:52 PM
  6. [SOLVED] How to retrieve desire text from input sheet to output sheet ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-12-2013, 06:13 PM
  7. Replies: 3
    Last Post: 10-10-2011, 02:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1