Hi
Please be gentle - after 10 years since I hung up my VBA programming hat, I've jumped back in it and to be fair I am really struggling. What I am after is probably dead easy but I need some help please
Below is my code
Sub test()
Dim strinput As Variant
strinput = Application.InputBox(prompt:="How old is the building?", Title:="WD Data inputer", Default:="", Type:=2)
If strinput = False Then
Range("A1").Value = ""
Exit Sub
End If
If strinput = "" Then
MsgBox "Please enter a value", vbInformation, "WD Inputer"
Exit Sub
End If
If strinput = True Then
Range("A1").Value = "The building is " & strinput & " years old"
Exit Sub
End If
End Sub
----Basically what I am after is if the value entered is blank then the error message appears and the input box appears again until either a value is entered or the use clicks cancel.
My head is really hurting, Can someone please help and fill in the missing code as appose to telling me how to do it, cause at this point in time I just cant get my head round it from reading the VBA examples.
Bookmarks