I'm new to VB coding.
I'm having trouble capturing numbers and dates with input boxes. I've got text strings working fine.
The code below prompts user to input four key variables to a template.
I've tried various formats for the variables "Price" and "closeddate" but this codealways fails when you enter a price (3rd Input Box)
I read help about TYPE codes in the Input Box Application vs. Input Box method that this uses, but I'm missing something.
Could someone please point me in the right direction on that.
Also, if someone could point me to a reference on how to handle the user clicking cancel in the input box...
(The variable "newsheetname" is defined previously in this macro's code. It's working fine for the first two Input Boxes.)
Thanks in advance.
Dim seller As String
Dim Buyer As String
Dim Price As String
Dim closedate As String
seller = InputBox("Enter Seller's Name", "Seller's", "Type Seller's Name Here")
Worksheets(newsheetname).Range("D7").Value = seller
Buyer = InputBox("Enter Buyer's Name", "Buyer's", "Type Buyer's Name Here")
Worksheets(newsheetname).Range("i7").Value = Buyer
Price = InputBox("Enter Contract's Purchase Price", "Purchase Price", "Enter Purchase Price Here")
Worksheets(newsheetname).Range ("i11"), Value = Price
closedate = InputBox("Enter Contract's Proposed Closing Date", "Close Date", "Enter Prposed Closing Date Here")
Worksheets(newsheetname).Range ("i9"), Value = closedate
Bookmarks