Excel experts conve...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Excel experts convene

8 Posts
5 Users
0 Reactions
68 Views
Posts: 1103
Free Member
Topic starter
 

How do I add a button at the end of a data entry form in Excel which users would press once finishing data entry which would then send an automatic email message to 2 of my colleagues to let them know someone had submitted data?

I've designed the form in VBA. I've been adding buttons using the toolbox which is currently the limit of my VBA knowledge.

Thanks in advance.


 
Posted : 28/11/2018 12:47 pm
Posts: 17
Free Member
 

https://powerspreadsheets.com/send-email-excel-vba/

You using outlook?


 
Posted : 28/11/2018 12:51 pm
Posts: 0
Full Member
 

Create a button, assign the code to the button.


 
Posted : 28/11/2018 12:53 pm
Posts: 6257
Full Member
 

No offence bikebuoy, but that advice is a bit:


 
Posted : 28/11/2018 1:05 pm
Posts: 1103
Free Member
Topic starter
 

Thanks all.


 
Posted : 28/11/2018 1:23 pm
Posts: 1103
Free Member
Topic starter
 

Is it possible to change a form list box colour depending on what list item is selected? I'd like to highlight that box in red if one of the options is selected ie 'cancel so other users are made aware. Ideally I'd like to highlight the whole row in which that box is like you can in excel conditional formatting.

Thanks in advance.


 
Posted : 30/11/2018 11:13 am
Posts: 13594
Free Member
 

Try...

ListboxName.BackColor=


 
Posted : 30/11/2018 11:27 am
Posts: 1103
Free Member
Topic starter
 

Thank you. Do I type that into the code lines for that list box? I can change the colour of the box using the properties box but can't seem to have it change depending on whether I select yes or no in the list box. I've currently somehow got it where no is blue and yes is red so I'm happy with that.

Thanks again all.


 
Posted : 30/11/2018 12:19 pm
Posts: 13594
Free Member
 

first you need to detect that something has changed, so in the VBA code editor, for that form you need to create an event procudure eg

private sub ListBox_Change

end sub

This will get called each time the value in the Listbox called "ListBox" changes.

You then need to decide what to do eg

private sub ListBox_Change

if ListBox.value = "Fred" then

ListboxName.BackColor=Colour_for_fred

else

ListboxName.BackColor=Colour_default

endif

end sub

etc...


 
Posted : 30/11/2018 12:31 pm

6 DAYS LEFT
We are currently at 95% of our target!