Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Sending ONLY Range or Page x, BUT not entire Activesheet, How ?

I want to adapt this:
.HTMLBody = SheetToHTML(ActiveSheet)

How can i only have a selected range of cells, or a selected page sent in the body of an email instaed of the entire sheet as it currently does?
Any idea's ??

I want to send a range of ("A45:I107") or
Page 1


Corey....
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Sending ONLY Range or Page x, BUT not entire Activesheet, How ?

Hi Corey,

See Ron de Bruin's example code at:

http://www.rondebruin.nl/mail/folder3/mail4.htm


---
Regards,
Norman


"Corey" wrote in message
...

I want to adapt this:
.HTMLBody = SheetToHTML(ActiveSheet)

How can i only have a selected range of cells, or a selected page sent in
the body of an email instaed of the entire sheet as it currently does?
Any idea's ??

I want to send a range of ("A45:I107") or
Page 1


Corey....


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Sending ONLY Range or Page x, BUT not entire Activesheet, How ?

Thanks.
I can see the code there, but cannot still find the code to Select ONLY
cells say (B45:I107)

Is it there some where, as i cannot see any reference to cell ranges.

Corey....

"Norman Jones" wrote in message
...
Hi Corey,

See Ron de Bruin's example code at:

http://www.rondebruin.nl/mail/folder3/mail4.htm


---
Regards,
Norman


"Corey" wrote in message
...

I want to adapt this:
.HTMLBody = SheetToHTML(ActiveSheet)

How can i only have a selected range of cells, or a selected page sent in
the body of an email instaed of the entire sheet as it currently does?
Any idea's ??

I want to send a range of ("A45:I107") or
Page 1


Corey....



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Sending ONLY Range or Page x, BUT not entire Activesheet, How ?

Hi Corey,

I can see the code there, but cannot still find the code to Select ONLY
cells say (B45:I107)

Is it there some where, as i cannot see any reference to cell ranges.


The suggested code includes the line:

Set source = Selection

Try changing Selection to your required range.


---
Regards,
Norman


"Corey" wrote in message
...
Thanks.
I can see the code there, but cannot still find the code to Select ONLY
cells say (B45:I107)

Is it there some where, as i cannot see any reference to cell ranges.

Corey....

"Norman Jones" wrote in message
...
Hi Corey,

See Ron de Bruin's example code at:

http://www.rondebruin.nl/mail/folder3/mail4.htm


---
Regards,
Norman


"Corey" wrote in message
...

I want to adapt this:
.HTMLBody = SheetToHTML(ActiveSheet)

How can i only have a selected range of cells, or a selected page sent in
the body of an email instaed of the entire sheet as it currently does?
Any idea's ??

I want to send a range of ("A45:I107") or
Page 1


Corey....





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Sending ONLY Range or Page x, BUT not entire Activesheet, How ?

Thnaks again Norman, but i cannot get ONLY a range of cells to email instead
of the whole activesheet.

Code current below:

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = ThisWorkbook.Sheets("Sheet1").Range("B53").Value ' address in
sheet
.CC = ThisWorkbook.Sheets("Sheet1").Range("E53").Value ' cc
address in sheet
.BCC = ""
.Subject = ThisWorkbook.Sheets("Sheet1").Range("B55").Value '
subject line info in sheet
' .Body = bodyStr.("Sheet1").Range("B45:I107")
<----------------- Tried this to no avail also
.HTMLBody = SheetToHTML(ActiveSheet) '
<----------------- WANT TO SET THIS TO SEND IN BODY AS HTML ONLY
RANGE("B45:I107") NOT WHOLE SHEET
' .Attachments.Add () Add a file address here to add an attachment
later
.Display '.send to auto send without prompting
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


I looked at the 'Set source = Selection' but i could not get it to work
either.

Any idea's ?


Corey....
"Norman Jones" wrote in message
...
Hi Corey,

I can see the code there, but cannot still find the code to Select ONLY
cells say (B45:I107)

Is it there some where, as i cannot see any reference to cell ranges.


The suggested code includes the line:

Set source = Selection

Try changing Selection to your required range.


---
Regards,
Norman


"Corey" wrote in message
...
Thanks.
I can see the code there, but cannot still find the code to Select ONLY
cells say (B45:I107)

Is it there some where, as i cannot see any reference to cell ranges.

Corey....

"Norman Jones" wrote in message
...
Hi Corey,

See Ron de Bruin's example code at:

http://www.rondebruin.nl/mail/folder3/mail4.htm


---
Regards,
Norman


"Corey" wrote in message
...

I want to adapt this:
.HTMLBody = SheetToHTML(ActiveSheet)

How can i only have a selected range of cells, or a selected page sent
in the body of an email instaed of the entire sheet as it currently
does?
Any idea's ??

I want to send a range of ("A45:I107") or
Page 1


Corey....









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sending ONLY Range or Page x, BUT not entire Activesheet, How ?

Hi Corey

Look at this link
http://www.rondebruin.nl/mail/folder3/mail4.htm

You see this line in the code
Set source = Selection

Change that to

Set source = ThisWorkbook.Sheets("Sheet1").Range("B45:I107")

Note that I use the Function RangetoHTML in this example


--
Regards Ron De Bruin
http://www.rondebruin.nl



"Corey" wrote in message ...
Thnaks again Norman, but i cannot get ONLY a range of cells to email instead of the whole activesheet.

Code current below:

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = ThisWorkbook.Sheets("Sheet1").Range("B53").Value ' address in sheet
.CC = ThisWorkbook.Sheets("Sheet1").Range("E53").Value ' cc address in sheet
.BCC = ""
.Subject = ThisWorkbook.Sheets("Sheet1").Range("B55").Value ' subject line info in sheet
' .Body = bodyStr.("Sheet1").Range("B45:I107") <----------------- Tried this to no avail also
.HTMLBody = SheetToHTML(ActiveSheet) ' <----------------- WANT TO SET THIS TO SEND IN BODY AS HTML ONLY RANGE("B45:I107")
NOT WHOLE SHEET
' .Attachments.Add () Add a file address here to add an attachment later
.Display '.send to auto send without prompting
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


I looked at the 'Set source = Selection' but i could not get it to work either.

Any idea's ?


Corey....
"Norman Jones" wrote in message ...
Hi Corey,

I can see the code there, but cannot still find the code to Select ONLY cells say (B45:I107)

Is it there some where, as i cannot see any reference to cell ranges.


The suggested code includes the line:

Set source = Selection

Try changing Selection to your required range.


---
Regards,
Norman


"Corey" wrote in message ...
Thanks.
I can see the code there, but cannot still find the code to Select ONLY cells say (B45:I107)

Is it there some where, as i cannot see any reference to cell ranges.

Corey....

"Norman Jones" wrote in message ...
Hi Corey,

See Ron de Bruin's example code at:

http://www.rondebruin.nl/mail/folder3/mail4.htm


---
Regards,
Norman


"Corey" wrote in message ...

I want to adapt this:
.HTMLBody = SheetToHTML(ActiveSheet)

How can i only have a selected range of cells, or a selected page sent in the body of an email instaed of the entire sheet as
it currently does?
Any idea's ??

I want to send a range of ("A45:I107") or
Page 1


Corey....









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
How to delete entire page 2 so document shows as 1 page only Elinita New Users to Excel 1 November 22nd 09 06:35 PM
Sending an entire worksheet [email protected] Excel Discussion (Misc queries) 3 November 23rd 06 03:01 PM
Resetting the activesheet used range Mike Fogleman Excel Programming 0 September 8th 04 01:02 PM
Resetting the activesheet used range Norman Jones Excel Programming 1 September 8th 04 11:57 AM
ActiveSheet.Printout or Page Setup? Michelle Excel Programming 0 April 23rd 04 03:55 PM


All times are GMT +1. The time now is 10:19 AM.

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

About Us

"It's about Microsoft Excel"