Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Can some one please look at the following and tell me why i'm getting a
mismatch error? Set EmailAddr = Application.InputBox("Select Email Addresses, Click on the Email Worksheet" & vbCrLf & '"Hold down Contrl Key to select multiple addresses", Type:=8) Destination = "" For Each cell In EmailAddr If Destination = "" Then 'Destination = cell 'Else Destination = Destination & ";" & cell 'End If Next cell |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Handle the error as below...
Sub Macro() Dim myRange As Range On Error Resume Next Application.DisplayAlerts = False Set myRange = Application.InputBox(Prompt:= _ "Select Email addresses", Type:=8) On Error GoTo 0 Application.DisplayAlerts = True If myRange Is Nothing Then MsgBox "You cancelled the operation" Exit Sub Else For Each cell In myRange If cell.Text < "" Then Destination = Destination & ";" & cell Next Destination = Mid(Destination, 2) End If End Sub -- Jacob "Neil Holden" wrote: Can some one please look at the following and tell me why i'm getting a mismatch error? Set EmailAddr = Application.InputBox("Select Email Addresses, Click on the Email Worksheet" & vbCrLf & '"Hold down Contrl Key to select multiple addresses", Type:=8) Destination = "" For Each cell In EmailAddr If Destination = "" Then 'Destination = cell 'Else Destination = Destination & ";" & cell 'End If Next cell |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for the reply Jacob, however this is a strange one, columns A, B and C
are hidden and it says operation canceled when the email address is selected. If i unhide he columns it works? Thanks again. "Jacob Skaria" wrote: Handle the error as below... Sub Macro() Dim myRange As Range On Error Resume Next Application.DisplayAlerts = False Set myRange = Application.InputBox(Prompt:= _ "Select Email addresses", Type:=8) On Error GoTo 0 Application.DisplayAlerts = True If myRange Is Nothing Then MsgBox "You cancelled the operation" Exit Sub Else For Each cell In myRange If cell.Text < "" Then Destination = Destination & ";" & cell Next Destination = Mid(Destination, 2) End If End Sub -- Jacob "Neil Holden" wrote: Can some one please look at the following and tell me why i'm getting a mismatch error? Set EmailAddr = Application.InputBox("Select Email Addresses, Click on the Email Worksheet" & vbCrLf & '"Hold down Contrl Key to select multiple addresses", Type:=8) Destination = "" For Each cell In EmailAddr If Destination = "" Then 'Destination = cell 'Else Destination = Destination & ";" & cell 'End If Next cell |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 coding issue | Excel Discussion (Misc queries) | |||
Excel VBA coding problem | Excel Discussion (Misc queries) | |||
Excel VBA Coding for Printing | Excel Discussion (Misc queries) | |||
Can Excel do this with coding? | Excel Worksheet Functions | |||
help with coding in excel | Excel Worksheet Functions |