• 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.

Why String is not visible

ThrottleWorks

Excel Ninja
Hi,

I am prompting user to write a date in an Input box.
Macro is getting the input box method correct however when I try to populate this string in cell the string is not visible.

If I check the value of "ThisWorkbook.Worksheets("Filepath").Range("xdf1").Value" in immediate window it shows correctly but it is not populated in the cell.

Can anyone please help me in this.


Code:
'Input Date
    Dim TheString As String, TheDate As Date
    TheString = Application.InputBox("Enter A Date in MM/DD/YYYY format only")
        If IsDate(TheString) Then
                TheDate = DateValue(TheString)
            Else
                MsgBox "Invalid date"
        End If
    ThisWorkbook.Worksheets("Filepath").Range("xdf1").Value = TheString
 
Code is fine... but Worksheets("Filepath").Range("xdf1")
Make sure there is sheet named "Filepath" and change Range to be within normal Excel cell... Ex. "A1"
 
Hi @Chihiro , thanks a lot for the help. Sure, I will check and get back.

Have a nice day ahead. :)

PS - My mistake. I was doing Range("xdf1") instead of Range("xfd1").

Typo of df instead of fd. Sorry for the trouble. :(
 
Back
Top