• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need to be able to enter a Date in a input box and it populate in the spreadsheet

Good Morning, I am stuck. Can you please help me?:(
I have written this code, but am at a loss as to how to actually make what they enter populate in Cell A2.

Or How to make it a mandatory enter, (Loop)

Dim Month As String
Dim p As String

p = "Enter first day of the last month In August enter 07-01-YYYY"
Range("A2").Select
Do
Month = InputBox(Prompt:=p)
Loop Until Month <> ""
FirstSpace = InStr(Month, " ")
MsgBox "Macro Finished"

I worked on this for 2 hours yesterday and another hour today plus read through all sorts of tutorials here and stuff I found on Bing, but cannot find anything that relates to populating a field directly using an inputbox.
 
Hi utsav, no that did not work. It cleared the data in A2, but did not input what I entered into the inputbox. I attached the file and the macro...

EDITED (SirJB7)
 

Attachments

  • EMP TURNOVER Macro.xlsm
    26.4 KB · Views: 7
@ireland13752
Hi!
I edited your previous post and deleted 2nd uploaded file (Empl List 213-082.xlsx) since it contained personal information of 508 people, whom I think neither were advised about this publication nor have authorized it. If I'm wrong, upload again the same file, but if I'm not, take care of privacy concerns and don't make publicly available personal and job information. If needed to maintain the workbook structure change sensitive and personal info to dummy or random values.
Regards!
 
Hi utsav, no that did not work. It cleared the data in A2, but did not input what I entered into the inputbox. I attached the file and the macro...

EDITED (SirJB7)
I have edited the code and it seems to work, in case you wanted to accomplish something else then please explain

Sub SNF_Employee_Turnover()
Dim Month As String
Dim p As String
p = "Enter first day of the last month In August enter 07-01-YYYY"
Sheet1.Range("A2").Select
Do
Month = InputBox(Prompt:=p)
Loop Until Month <> ""
FirstSpace = InStr(Month, " ")
Sheet1.Range("A2").Value = Month
MsgBox "Macro Finished"
End Sub

Can't upload the file as its against company policy :/

Just call this macro and value in A2 should change, replace "Sheet1" with the correct sheet name
 
Back
Top