Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using excel 2000. Can someone help me revise the following code to
allow for a carriage return by the user while inputting text for the chart title. Or is there an easier method that allows a user to enter a title into a chart besides a message box? Joel Mills Sub ChartHeader() ' ActiveSheet.ChartObjects("Curve Chart").Activate ActiveChart.ChartArea.Select With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = InputBox("Enter the Chart Title Here" & vbCr & _ "after creating the title select" & vbCr & " where you want to start a new line |" _ & vbCr & "and hit enter to force a to a new line.") End With End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Joel,
I don't believe there is a way to force a carriage return during text entry in an Input box. However, you can put one in after the entry is complete. Note: the following code will only force one additional line... '----------------------------- Sub SplitInputBoxText() Dim strInput As String Dim lngDot As Long strInput = InputBox("Enter the Chart Title below." & vbCr & _ "A new line will automatically be started after a period (dot).", _ "Enter Chart Title", "Chart Title") If Len(strInput) = 0 Then Exit Sub Else lngDot = InStr(1, strInput, ".", vbTextCompare) If lngDot 1 Then strInput = Left$(strInput, lngDot) & vbCr & _ LTrim$(Right$(strInput, Len(strInput) - lngDot)) End If End If MsgBox strInput End Sub '-------------------- Regards, Jim Cone San Francisco, USA "Joel Mills" wrote in message ... I'm using excel 2000. Can someone help me revise the following code to allow for a carriage return by the user while inputting text for the chart title. Or is there an easier method that allows a user to enter a title into a chart besides a message box? Joel Mills Sub ChartHeader() ActiveSheet.ChartObjects("Curve Chart").Activate ActiveChart.ChartArea.Select With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = InputBox("Enter the Chart Title Here" & vbCr & _ "after creating the title select" & vbCr & " where you want to start a new line |" _ & vbCr & "and hit enter to force a to a new line.") End With End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim, thanks for your reply. I think the users will just have to input a
carriage return into the Chart Title as they would if they created the chart using chart wizard. "Jim Cone" wrote in message ... Joel, I don't believe there is a way to force a carriage return during text entry in an Input box. However, you can put one in after the entry is complete. Note: the following code will only force one additional line... '----------------------------- Sub SplitInputBoxText() Dim strInput As String Dim lngDot As Long strInput = InputBox("Enter the Chart Title below." & vbCr & _ "A new line will automatically be started after a period (dot).", _ "Enter Chart Title", "Chart Title") If Len(strInput) = 0 Then Exit Sub Else lngDot = InStr(1, strInput, ".", vbTextCompare) If lngDot 1 Then strInput = Left$(strInput, lngDot) & vbCr & _ LTrim$(Right$(strInput, Len(strInput) - lngDot)) End If End If MsgBox strInput End Sub '-------------------- Regards, Jim Cone San Francisco, USA "Joel Mills" wrote in message ... I'm using excel 2000. Can someone help me revise the following code to allow for a carriage return by the user while inputting text for the chart title. Or is there an easier method that allows a user to enter a title into a chart besides a message box? Joel Mills Sub ChartHeader() ActiveSheet.ChartObjects("Curve Chart").Activate ActiveChart.ChartArea.Select With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = InputBox("Enter the Chart Title Here" & vbCr & _ "after creating the title select" & vbCr & " where you want to start a new line |" _ & vbCr & "and hit enter to force a to a new line.") End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Carriage return | Excel Discussion (Misc queries) | |||
Carriage Return | Excel Worksheet Functions | |||
Carriage return in a cell | Excel Programming | |||
Creating carriage returns in msg or input boxes | Excel Programming | |||
Carriage Return | Excel Programming |