Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Email Macro help!


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


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Email Macro help!

Thank You so much John, that was exactly, EXACTLY as I needed! The vba
does work now the way I was needing (to email to only the person in
the selected row)! I do very much appreciate your help.
Ken
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email macro Kevin Excel Discussion (Misc queries) 0 December 18th 07 09:30 PM
How do I create an email macro to auto fill the email? Justin[_4_] Excel Discussion (Misc queries) 0 November 14th 07 10:49 PM
macro to email Scott Marcus Excel Discussion (Misc queries) 1 June 21st 06 03:04 PM
Macro To Email XLS ynissel Excel Discussion (Misc queries) 4 May 26th 05 07:12 PM
Email/Save/Macro John Excel Worksheet Functions 1 March 28th 05 07:32 PM


All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"