Results 1 to 6 of 6

Prepopulated inputbox with current fiscal year, month, day

Threaded View

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    71

    Prepopulated inputbox with current fiscal year, month, day

    ~~ Correction, Fiscal year is not needed. Calender year please.

    I am working on a work project so that when a user clicks a command button, it clears all daily data out of a log to create a new log for the next cylce. Everything works in my code, but I was wondering if there was a way to pre-populate the inputbox so the user doesn't have to type as much into the box, just verify that it is correct and add the next number. Our daily numbers go YY MM DD ABC ###. The ### only changes when we have multiple missions per day, so this would be user inputted. The "ABC" is always "ABC", YY MM DD is the two digit year, month, day.

    Thank you!!

    Private Sub CommandButton1_Click()
    Response = MsgBox("Are you sure you want to clear all data?", vbYesNo)
     
    If Response = vbNo Then
        Exit Sub
    End If
    
    
    
    
    ThisWorkbook.Worksheets("Datasheet").Range("B1:D1, G1:J1, O1:Q1, T1, W1, A5:D31, G5:Q31, S5:V31, Y5:AC31").ClearContents
    Range("G5:I5, Y5:AA5").Value = "1"
    
    Range("G1").Select
    
    
    
    
    Response = MsgBox("Do you wish to save as a new file?", vbYesNo)
    If ((Response = "False") Or (Response = vbNullString)) Then Exit Sub
    If Response = vbNo Then
        Exit Sub
    End If
          newmissionnumber = UCase(Application.InputBox("Enter the FULL new Mission Number."))
    If ((newmissionnumber = "False") Or (newmissionnumber = vbNullString)) Then Exit Sub
    If newmissionnumber = False Then Exit Sub
    ThisWorkbook.Worksheets("Datasheet").Range("B1:D1").Value = newmissionnumber
    If Response <> False Then
    
    ThisFile = "ABCDEFGH " & newmissionnumber & ".xlsm"
    Application.Dialogs(xlDialogSaveAs).Show (ThisFile)
    
    End If
    
    End Sub
    Last edited by jwlamb; 10-07-2013 at 01:36 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Chart titles that update with current fiscal year
    By dcdeez in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-18-2013, 03:29 PM
  2. how to convert date to fiscal year if fiscal year start at 16th or 17th of July
    By sushil shakya in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-28-2013, 03:32 AM
  3. [SOLVED] Create Fiscal Year - Lookup Date in Fiscal Month Date Range and Return EOM Date
    By gbriscoe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-25-2013, 03:29 PM
  4. autocalculate current week of fiscal year?
    By zb61 in forum Excel General
    Replies: 6
    Last Post: 06-14-2012, 02:29 AM
  5. [SOLVED] Pivot: Replace month numbers with month names and sort by fiscal year
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2011, 02:13 PM

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