#1
|
|||
|
|||
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 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Variable arrays from user input | SeattleITguy | Excel Programming | 1 | 01-29-2015 09:19 AM |
Taking input from InputBox from user | SeattleITguy | Excel Programming | 1 | 01-28-2015 09:05 AM |
vba: user input named argument | andrew12345 | Excel Programming | 2 | 11-18-2014 08:18 AM |
User input to a variable on the document | dsm1995gst | Word VBA | 1 | 09-03-2013 03:43 PM |
Look up an array based on user input | johnsmb | Excel | 2 | 01-07-2011 01:12 PM |