View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John Bundy John Bundy is offline
external usenet poster
 
Posts: 772
Default Email Macro help!

Your For statement makes it look like you are trying to email 8200 people,
but your wording leads me to believe you only want to email data for the row
selected. If that is the case then you don't need a For/Next:
ActiveCell.Row
that gets the row number that you currently have selected.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Ken" wrote:


I had posted this earlier in another group and I am not sure if I
should not have posted it here instead. My apologies for the double
post.
I am trying to email from Excel, but I only want
to email only from the current row after I right click on cell 13 in
that particular row. Here is just a snippet of what I found that uses
a For Next loop, but I only want the selected row, not all 8200+
rows.
How can this be changed from a For Next loop?? Any help is greatly
appreciated:

Private Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String,
ByVal lpFile As String, ByVal lpParameters As String, ByVal
lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub SendEMail()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
For r = 2 To 8208

I can post all of the code if needed, but I think all that I need is
how to change the "For r" line to allow me to email the selected
client on a particular row on the spreadsheet.
Thanks for any and all help in advance.
Ken