View Single Post
 
Old 11-12-2015, 08:16 AM
ChrisJ83 ChrisJ83 is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Nov 2015
Posts: 9
ChrisJ83 is on a distinguished road
Default User input box with IF statement

Hi

I was wondering if anyone could help/point me in the right direction, I have the following macro

Sub PromptText()
'
' PromptText Macro
'
'
Dim TopLineText As String
TopLineText = InputBox("Top Line Text?", "")
Selection.TypeText Text:=TopLineText
Selection.TypeParagraph
End Sub

Which works fine however I would like it to only add the TypeParagraph if any text is input. If the prompt is left blank I would like it to effectively do nothing (stay on the same line) as I will add additional commands to the macro once this is sorted.

Any advice appreciated.

Cheers
Chris
Reply With Quote