Use Inputbox To Select The Range To Email.

  • I would like to use an inputbox to identify the range I wish to email.


    I am using VB Erange = ImputBox("Name the Range you wish to Send", "Email Range"


    I also have .body = "EMAILRANGE",


    That is what appears in the body of the email. The text, not the acutal values from the named range EMAILRANGE appears.


    I am trying to use Ron de Bruin "Mail Range or Selection in the body " but didn't uderstand the statement ' Don't forget to copy the function RangetoHTML in the module.[hr]*[/hr] Auto Merged Post;[dl]*[/dl]Oops, i have some code in there without putting the text "code" on each side.

  • Re: Use Inputbox To Select The Range To Email.


    When Ron says,

    Quote

    Don't forget to copy the function RangetoHTML in the module.


    He is referring to the function below his code which converts the cells to HTML ready for using in the body of the email.


    As for the input box try
    [vba]
    Dim myRng as range


    Set myRng = Application.InputBox(prompt:="Select cells", Type:=8)
    [/vba]

    [h4]Cheers
    Andy
    [/h4]

  • Re: Use Inputbox To Select The Range To Email.


    In regards to the function code.


    Where do I add that or how do I get it to run?


    I tried to add the function module just before the End Sub, but that didn't work.


    I copied both just like he had them and posted them into a new macro(2) and still didn't get it to work.

  • Re: Use Inputbox To Select The Range To Email.


    You start by adding a new module to your workbook.
    The copy and paste both set of code into it.


    It sounds like you are currently paste the code into existing routines, which will not work.

    [h4]Cheers
    Andy
    [/h4]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!