Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Email macro | Excel Discussion (Misc queries) | |||
How do I create an email macro to auto fill the email? | Excel Discussion (Misc queries) | |||
macro to email | Excel Discussion (Misc queries) | |||
Macro To Email XLS | Excel Discussion (Misc queries) | |||
Email/Save/Macro | Excel Worksheet Functions |