ERRORS IN CODE 2003

N

Neil Holden

Hi all gurus, i am getting errors on the code below:

I can click a worksheet and select multiple email addresses but its not
working.

Set EmailAddr = Application.InputBox("Select Email Addresses - Click on the
Email Worksheet" & vbCrLf & _
"Hold down Ctrl Key to select multiple addresses", Type:=8)

Neil.
 
M

Mike H

Neil the code will create a range and it can be non contiguous by holding
down the ctrl key and clicking. Try this and it will loop through that range
giving the address of each cell.

Dim EmailAddr As Range
Set EmailAddr = Application.InputBox("Select Email Addresses - Click on the
Email Worksheet" & vbCrLf & _
"Hold down Ctrl Key to select multiple addresses", Type:=8)


For Each c In EmailAddr
MsgBox c.Address
Next
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 

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