Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete entire page 2 so document shows as 1 page only | New Users to Excel | |||
Sending an entire worksheet | Excel Discussion (Misc queries) | |||
Resetting the activesheet used range | Excel Programming | |||
Resetting the activesheet used range | Excel Programming | |||
ActiveSheet.Printout or Page Setup? | Excel Programming |