Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default e-mail range of cells

Hi Vee,

Instead of
strto = Sheets("HPP").Range("F2").Value
strsub = Sheets("HPP").Range("A2").Value
strbody = Sheets("HPP").Range("J2").Value

try something like:
strto=sheets("HPP").cells(target.row,target.column-2)

strsub=sheets("HPP").cells(target.row,target.colum n-7)

strbody=sheets("HPP").cells(taget.row,target.colum n+2)

Hope this will help..



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default e-mail range of cells

zantor wrote in message ...
Hi Vee,

Instead of
strto = Sheets("HPP").Range("F2").Value
strsub = Sheets("HPP").Range("A2").Value
strbody = Sheets("HPP").Range("J2").Value

try something like:
strto=sheets("HPP").cells(target.row,target.column-2)

strsub=sheets("HPP").cells(target.row,target.colum n-7)

strbody=sheets("HPP").cells(taget.row,target.colum n+2)

Hope this will help..



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



hi
i don't understand please explain:

strto=sheets("HPP").cells(target.row,target.column-2)

strsub=sheets("HPP").cells(target.row,target.colum n-7)

strbody=sheets("HPP").cells(taget.row,target.colum n+2)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default e-mail range of cells

Hi Vee,

In your sub "Worksheet_Change(ByVal Target As Range)",
there is a parameter named 'Target', which has a 'Column' property as
well as a 'Row' property. So when you select a cell you can get the row
number as well as the column number of the selected cell.

If the current selected cell is "H2", then "Target.Row=2 " and
"Target.Column=8". If you want the email address in that row, then
"Target.Column-2" would give you column 6 or "F".

If "H2" is selected then:
Cells(Target.Row,Target.Column-2) means cells(2,6) or "F2"

Note that the 'Target' object is only valid in the sub where it is
declared, in this case "Worksheet_Change(ByVal Target As Range)"

Hope this helps..



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

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
Mailing an excel range in the body of an e-mail Andy Tallent Excel Discussion (Misc queries) 4 April 25th 12 10:14 AM
Why do some Excel cells refer to e-mail? Fred in Keswick Excel Worksheet Functions 1 February 28th 06 10:09 PM
how to compute a range of cells based on another range of cells? HAROLD Excel Worksheet Functions 1 December 30th 05 09:32 PM
how to compute a range of cells based on another range of cells? HAROLD Excel Worksheet Functions 2 December 30th 05 07:55 PM
Mail a different files to each person in a range [email protected] Excel Worksheet Functions 5 September 2nd 05 02:00 PM


All times are GMT +1. The time now is 11:43 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"