Formatting Text in an InputBox

MattCiccone

New Member
Joined
Jul 10, 2010
Messages
30
Can it be done?

I'd like to have two lines, both centered, and the second one bold.

How can I do that....?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
You can have multiple lines:

Code:
    Dim Ans As Variant
    Ans = InputBox("Line1" & vbCrLf & "Line 2")

But you can't format any of the text.
 
Upvote 0
Got it. Now I'm having a problem where I'm getting an error message when I use the InputBox...

I'm not sure it has anything to do with adding the new line, becuase it happens all the time.


I've got the input box using a search for a specific date....I have them enter the date in the same format as my date cells on other sheets, and I'm using xlWhole instead of part for obvious reasons.

I get an error every time.....any solutions?
 
Upvote 0
PS:

Here's my code:


Sub Search()
Dim Symbol As Symbol, ws As Worksheet, Found As Range, c As Range
Search:
Symbol = InputBox("Please enter the date you wish to update." & vbCrLf & vbCrLf & "IMPORTANT: Enter date as m/d/yyyy")
On Error GoTo Error
For Each ws In Worksheets
If ws.Name <> "Summary" Then
Set Found = ws.Columns("A").Cells.Find(What:=Symbol, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False)
If Not Found Is Nothing Then
Application.Goto Reference:=Found
Exit Sub
End If
End If
Next ws
Error:
Msg = "Either the date you entered is not a trading day or "
Msg = Msg & "you entered the date in the wrong format. " & vbNewLine & vbNewLine
Msg = Msg & "Please enter all dates as: mm/dd/yyyy and be sure you have the correct date!"
MsgBox Msg, vbCritical, "UnKnown Date"
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,239
Members
448,555
Latest member
RobertJones1986

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