+ Reply to Thread
Results 1 to 4 of 4

Macros that:Email,FindNext

  1. #1
    Registered User
    Join Date
    09-05-2005
    Posts
    18

    Macros that:Email,FindNext

    Hi All

    Any advice people could offer on the couple of porobably stupid questions below would be much appreciated.

    1- I have an existing macro that splits a worksheet down into data specifically for a customer that i tell it at the beginning.
    I know macro's can email stuff, and have worked out how to send the file to a recipitent, with a subject, but i cant work out how to put in some message text.
    I cant really send the file automactically unless it has covering message text...

    2- Im trying to make another macro that finds the first title row in a sheet, formats it, and then finds the next title row and does the same, before moving onto the next sheet and doing the process again there. Have made an input box to tell it where to start the first title row, but cant work out how to make it find the next row.
    Assuming somesort of Loop where it checks cell values vs a variable sets as the first title row?
    And when it has reached the bottom of the sheet, i need it to move to the next sheet - how do i make it know where the end of the sheet is?

    Also how do i make it stop once it reaches the final sheet?

    Thanks!!!

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    some clues about how you are doing the mailing and how you would determine a header row would help.

    It is all too vague

  3. #3
    Registered User
    Join Date
    09-05-2005
    Posts
    18
    Apologies, didnt mean to be to vague.

    Re: Emailing the sheet

    The macro formats and selects relevant data, saves a seperate file, and ends in the syntax:
    ActiveWorkbook.SendMail Recipients:="Tim McHugh", Subject:="Your Reports"

    This emails succesfully emails a copy of the workbook which is what i want - i just want to also put some automatic message text in there along the lines of:
    "Dear Tim, Please find attached your monthly reports,Kind Regards, Me"

    Re: The heading rows (and finding the next one)
    I tell it in an input box where the first cell i want to format is. It then selects the rest of that row that contains values and proceeds to format that row (see syntax below-ive cut off the extensive formatting for ease).
    The problem i have is making it search for the next heading row (all it needs to do is find the next event where a cell = the same value as the start cell)
    Once its completed all header formatting on that sheet i want it to automatically go to the next sheet and ask me to tell it the startcell again.

    Dim StartFormat As String
    Dim Format As String
    StartFormat = InputBox("Enter a start cell reference (e.g. A1)", "Start Cell")
    Range(StartFormat).Select
    Format = ActiveCell.Value
    Range(ActiveCell, ActiveCell.End(xlToRight)).Select

    Thanks!

  4. #4
    Ron de Bruin
    Guest

    Re: Macros that:Email,FindNext

    Hi iambalrog

    This is not possible when you use SendMail
    If you use Outlook you can use the Outlook object model

    See my mail site
    http://www.rondebruin.nl/sendmail.htm


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


    "iambalrog" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Apologies, didnt mean to be to vague.
    >
    > Re: Emailing the sheet
    >
    > The macro formats and selects relevant data, saves a seperate file, and
    > ends in the syntax:
    > ActiveWorkbook.SendMail Recipients:="Tim McHugh", Subject:="Your
    > Reports"
    >
    > This emails succesfully emails a copy of the workbook which is what i
    > want - i just want to also put some automatic message text in there
    > along the lines of:
    > "Dear Tim, Please find attached your monthly reports,Kind Regards, Me"
    >
    > Re: The heading rows (and finding the next one)
    > I tell it in an input box where the first cell i want to format is. It
    > then selects the rest of that row that contains values and proceeds to
    > format that row (see syntax below-ive cut off the extensive formatting
    > for ease).
    > The problem i have is making it search for the next heading row (all it
    > needs to do is find the next event where a cell = the same value as the
    > start cell)
    > Once its completed all header formatting on that sheet i want it to
    > automatically go to the next sheet and ask me to tell it the startcell
    > again.
    >
    > Dim StartFormat As String
    > Dim Format As String
    > StartFormat = InputBox("Enter a start cell reference (e.g. A1)",
    > "Start Cell")
    > Range(StartFormat).Select
    > Format = ActiveCell.Value
    > Range(ActiveCell, ActiveCell.End(xlToRight)).Select
    >
    > Thanks!
    >
    >
    > --
    > iambalrog
    > ------------------------------------------------------------------------
    > iambalrog's Profile: http://www.excelforum.com/member.php...o&userid=26977
    > View this thread: http://www.excelforum.com/showthread...hreadid=494080
    >




+ 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