Results 1 to 3 of 3

Date in an Inputbox transferred to the specific cell of a worksheet

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Date in an Inputbox transferred to the specific cell of a worksheet

    Hi experts and gurus,

    I am at the end of the automated Report. I am looking to set up an input box that seeks the "Current Report Date" and "Last Report Date", which are then transferred to cells B1 and B2 of a worksheet respectively. The date will be in a specific format "DD/MM/YYYY".

    If the date is in invalid format, the message box will be prompted with "invalid date format".

    I have tried to write the following code which needs improvement to get the result.
    Private Sub A()
    
    Call reportingDate
    Worksheets("Test").Range("B1").Value = currep_date
    Worksheets("Test").Range("B2").Value = lastrep_date
    
    End Sub
    Function reportingDate()
    
    Dim currep_date As Date, lastrep_date As Date
    
       
        currep_date = InputBox("Enter Current Reporting Date", "Enter a Date")
        lastrep_date = InputBox("Enter Last Reporting Date", "Enter Date")
    
    End Function
    Can somebody help me to write a code to put a date that is transferred to B1 and B2?

    Thank you so much to all the experts and gurus to help me learn VBA.

    Roshan Shakya
    Last edited by Roshan.Shakya; 07-17-2019 at 03:24 PM. Reason: clarity

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 04-19-2018, 02:11 AM
  2. Replies: 3
    Last Post: 01-30-2018, 10:46 AM
  3. corruption transferred by every cell?
    By VerlindenG in forum Excel General
    Replies: 3
    Last Post: 09-07-2015, 09:01 AM
  4. [SOLVED] Userform Listbox selected data transferred to a Worksheet cell
    By Tony Hadj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2014, 02:51 AM
  5. Adding to figures transferred from another worksheet
    By KMac362 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-05-2013, 01:37 PM
  6. Conditional Formatting for specific date in another Worksheet Cell
    By Pooger in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-24-2013, 07:48 AM
  7. info/data transferred/copied from worksheet to worksheet in same workbook!
    By joe dech in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-17-2012, 02:53 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