+ Reply to Thread
Results 1 to 3 of 3

Trying to have radio button replace a variable in mail sender code then send

  1. #1
    Registered User
    Join Date
    11-17-2015
    Location
    Gainesville, FL
    MS-Off Ver
    2010
    Posts
    2

    Trying to have radio button replace a variable in mail sender code then send

    Hello All,

    So here is what I am trying to do. I am trying to have different radio buttons send an email to myself with the given code (seen below). I am trying to write a code that will replace the variable "A" with the corresponding option button number. (i.e. if its for optionbutton51, replace A with 51 and then begin the checkmail coding). I've been able to successfully press the radio button and have the mail sent, though it is not replacing the variable A with corresponding button number.

    Just a heads up, I am self teaching myself VBA by reading books in my spare time so I can assist my company run things a little better. If this is a simple fix, apologies for overlooking the simple coding. Below is the code I currently have. I tried previously to use the replace function as well, though it did not work. I also tied to include the option button in the createmail sub and wound up getting 422 emails due to not having a stop.


    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Last edited by emeeeee; 11-17-2015 at 03:20 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,785

    Re: Trying to have radio button replace a variable in mail sender code then send

    You can do most of the work in a worksheet to simplify the code. I suggest that instead of trying to detect the radio button itself in the code, link all your radio buttons (how many are there?) to a cell, then you can query the value of that cell in your code without having to worry about the buttons in code.

    Also note that your message and you subject are both referring to the same cell. Looks like that might be an error.

    See attached example. For this to work, it uses Form buttons instead of ActiveX. I usually prefer ActiveX, but the advantage of the form buttons here is that you can have a single cell that shows the index of the button that is pressed.
    Attached Files Attached Files
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-17-2015
    Location
    Gainesville, FL
    MS-Off Ver
    2010
    Posts
    2

    Re: Trying to have radio button replace a variable in mail sender code then send

    Jeff,

    Thank you for answering my thread. Your idea worked out great!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Code to send mail copying from Excel to a new outlook mail.
    By paz1987 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-11-2015, 07:54 AM
  2. Send Email but make sure they cannot reply to the sender
    By rpinxt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2014, 06:51 AM
  3. Inserting a button upon cell value that send an e-mail with saved format
    By 3nduranc3 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2013, 07:17 AM
  4. getting sender of the mail which send from Generic Mailbox
    By thirugusto in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 08-17-2012, 10:45 AM
  5. Code to send an e-mail. Don't send if attachment not found
    By thedon_1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2012, 05:41 PM
  6. automatic mail sender and notifier
    By sunny2u86 in forum Excel General
    Replies: 2
    Last Post: 02-02-2012, 02:55 AM
  7. Run code whenever any radio button is clicked
    By rwalk9sr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2007, 06:01 PM

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