+ Reply to Thread
Results 1 to 2 of 2

Copy worksheet and reset\clear form button

  1. #1
    Registered User
    Join Date
    03-03-2016
    Location
    Minneapolis, MN
    MS-Off Ver
    2007
    Posts
    3

    Copy worksheet and reset\clear form button

    I am creating an order form for custom doors. I need to create a button that will copy the worksheet and reset the fields to a set default for the customer to enter based on that door.

  2. #2
    Registered User
    Join Date
    03-03-2016
    Location
    Minneapolis, MN
    MS-Off Ver
    2007
    Posts
    3

    Re: Copy worksheet and reset\clear form button

    I figured out how to copy the worksheet using this:

    Private Sub CommandButton1_Click()
    Dim N As String, c As Integer, i As Integer, j As Integer
    N = InputBox("New Door Number")
    If N = "" Then Exit Sub
    Worksheets(ActiveSheet.Name).Copy after:=Worksheets(Worksheets.Count)
    ActiveSheet.Name = N
    c = Sheets.Count: For i = 1 To c - 1: For j = i + 1 To c
    If UCase(Sheets(j).Name) < UCase(Sheets(i).Name) Then Sheets(j).Move before:=Sheets(i)
    Next j: Next i:

    End Sub

    Is there a way to add in a clear/reset code for the newly created sheet?

+ 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. [SOLVED] Help with code to creat Reset button to clear cells and copy back the original formula
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-30-2015, 02:25 PM
  2. [SOLVED] Copy Form Control Button to new worksheet using vba
    By kingkyle2005 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-13-2013, 06:37 PM
  3. Replies: 1
    Last Post: 02-28-2013, 08:17 AM
  4. Create a clear/reset "button"?
    By splenguin in forum Excel General
    Replies: 10
    Last Post: 09-03-2009, 06:12 PM
  5. How do I clear a form without a button
    By Pam Field in forum Excel General
    Replies: 4
    Last Post: 07-11-2006, 01:35 PM
  6. Button to reset form values
    By propolis in forum Excel General
    Replies: 1
    Last Post: 01-28-2006, 12:55 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