Adding a Variable into Input Box Prompt

AliStott

New Member
Joined
Oct 11, 2006
Messages
14
Hi,

I am trying to create an input box that uses a variable in the prompt. The input box requests the charge rate for a contract that is not in the list. I already have the code, description and exchange information.

The code I have used is:

'If not found then add contract details to list and request currency and rate information

If ActiveCell.Value = "" Then
ActiveCell.Value = ContractCode
ActiveCell.Offset(0, 1).Value = Exchange
ActiveCell.Offset(0, 2).Value = ContractDesc

ExRequest = InputBox("Please enter the execution rate for " & ContractDesc&, "Execution Rate")
'if no response set rate to 0
If ExRequest = "" Then
ExMsg = MsgBox("No rate provided. Execution rate will default to 0!")
ExRate = 0
Else: ExRate = ExRequest
End If
ActiveCell.Offset(0, 4).Value = ExRate


Unfortunately, the code I used returns a compile error: "Type-declaration character does not match declared data type". I have declared the variable as a string using Dim ContractDesc As String, but that hasn't resolved the issue.

I'm sure its something simple and would appreciate any help.

Many Thanks
Ali.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi, AliStott,

remove the ampersand "&"
ContractDesc&

kind regards,
Erik

EDIT:
Welcome to the Board !!!!!
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,824
Members
449,050
Latest member
Bradel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top