Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-12-2015, 08:16 AM
ChrisJ83 ChrisJ83 is offline User input box with IF statement Windows 7 64bit User input box with IF statement Office 2013
Novice
User input box with IF statement
 
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
 



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
User input box with IF statement vba: user input named argument andrew12345 Excel Programming 2 11-18-2014 08:18 AM
User input box with IF statement 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft