persistent prompt for input

iisailor

Board Regular
Joined
Feb 18, 2009
Messages
58
i have a series of sub routines that work together to form one macro with the purpose of searching through a sheet, gathering results, putting these in the body of an outlook email then prompting the user for an email address and subject.
My question though is how to get my code to repeatedly prompt the user for these details. At best i currently have:
Code:
.Subject = InputBox(prompt:="Please enter email subject for:")
            If .Subject = 0 Then 'Cancel
                Exit Sub
                Else
                    If .Subject = "" Then
                    .Subject = InputBox(prompt:="Please enter email subject")
                    .Subject = True
                    End If
                End If

This ony prompts the user once for details and if they dont enter any they can stil continue. In shot i want to make the user have to enter an address and subject.
Any thoughts?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Example:

Code:
Sub Test()
    Dim Ans As Variant
    Do
        Ans = InputBox("Enter something")
        If Ans <> "" Then Exit Do
    Loop
    MsgBox Ans
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,634
Messages
6,120,659
Members
448,975
Latest member
sweeberry

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