+ Reply to Thread
Results 1 to 23 of 23

Sending ONLY Range or Page x, BUT not entire Activesheet, How ?

Hybrid View

  1. #1
    Corey
    Guest

    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. #2
    Norman Jones
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...

    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. #3
    Corey
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Corey,
    >
    > See Ron de Bruin's example code at:
    >
    > http://www.rondebruin.nl/mail/folder3/mail4.htm
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Corey" <[email protected]> wrote in message
    > news:[email protected]...
    >
    > 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. #4
    Norman Jones
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi Corey,
    >>
    >> See Ron de Bruin's example code at:
    >>
    >> http://www.rondebruin.nl/mail/folder3/mail4.htm
    >>
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >> "Corey" <[email protected]> wrote in message
    >> news:[email protected]...
    >>
    >> 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. #5
    Corey
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi Corey,
    >>>
    >>> See Ron de Bruin's example code at:
    >>>
    >>> http://www.rondebruin.nl/mail/folder3/mail4.htm
    >>>
    >>>
    >>> ---
    >>> Regards,
    >>> Norman
    >>>
    >>>
    >>> "Corey" <[email protected]> wrote in message
    >>> news:[email protected]...
    >>>
    >>> 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. #6
    Ron de Bruin
    Guest

    Re: 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" <[email protected]> wrote in message news:[email protected]...
    > 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" <[email protected]> wrote in message news:[email protected]...
    >> 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" <[email protected]> wrote in message news:[email protected]...
    >>> 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" <[email protected]> wrote in message news:[email protected]...
    >>>> Hi Corey,
    >>>>
    >>>> See Ron de Bruin's example code at:
    >>>>
    >>>> http://www.rondebruin.nl/mail/folder3/mail4.htm
    >>>>
    >>>>
    >>>> ---
    >>>> Regards,
    >>>> Norman
    >>>>
    >>>>
    >>>> "Corey" <[email protected]> wrote in message news:[email protected]...
    >>>>
    >>>> 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1