Limit text length with inputBox

B

BigDave

Here is the code I have:
Dim csComment As String
csComment = InputBox("Please enter your comment." & Chr(10) &
Chr(10) & "Comments are not required for No responses")
ActiveSheet.Range("l200") = csComment

I need to limit the text length to 40 characters or less. This
information will eventually be copied into a another workbook that
serves as a data sheet for a PivotTable.

BTW - I really appreciate all of the help I've recieved here. vb used
to really scare me and I stayed way clear of it. Not anymore. I've
got much to learn yet, but you guys have really helped me out a lot.
Thanks in advance!!!
 
G

Guest

Hi BigDave,

This should work

Sub LimitMyComment()

Dim csComment As String * 40

csComment = Application.InputBox("Please enter your comment." & Chr(10)
& _
Chr(10) & "Comments are not required for No responses", Type:=2)
ActiveSheet.Range("i200") = csComment

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top