input box to allow range OR strings

G

Greg

Hi,

I'd like the user to either select the range of cell with email addresses or
type it OR be able to type them in directly. I can only think of one either
declare a range or string. for example, when declaring a range my code looks
like following:


Set rngTo = Application.InputBox("Select range with addressees emails
for the 'TO:' field" & _
vbNewLine & "or enter emails here separated by semicolon", "Select",
Type:=8)

This won't allow a string to be typed in...
Can anything suggest the workaround?
Thank you,
 
F

FSt1

hi
tricky problem. you could use a msgbox to get a yes/no responce. something
like this...
Dim rngto As Range
Dim stgto As String
If MsgBox("Do you wish to enter the mail addresses?" & vbNewLine & _
"Click yes?" & vbNewLine & _
"Or to select email addresses by range" & vbNewLine & _
"Click No") = vbNo Then
Set rngto = Application.InputBox("Select range with addressees emails
for the 'TO:' field")
Else
Set stgto = Application.InputBox("Enter emails here separated by
semicolon.")
End If

lot of extra code but it would solve the delima.

Regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top