ERRORS IN CODE 2003

  • Thread starter Thread starter Neil Holden
  • Start date Start date
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.
 
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.
 
Back
Top