VBA to archive data with Specific Value & Macro to email when a button is clicked.

samunders

New Member
Joined
May 26, 2020
Messages
27
Office Version
  1. 2019
Hello Guys,

Firstly thank you for any help that comes my way, I am slowly picking up tips from this message board but I haven't quiet got my head around VBA.

I am building (trying to build) a handover sheet for active things of note, and when they are completed based on a yes value move that "active" hand over to the Archive sheet.

The first one is a macro to send a generic an email to 4 email addresses when a new submission is made, this is to prompt people to check the worksheet when something new is added.

The second is to copy and paste 1 row to the archive sheet and then delete 3 rows from the the active sheet, with the archives auto sorted to with most recent.

I hope this and the screen shots help

Thank you so much for any help offered.
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    127 KB · Views: 10
  • Capture2.PNG
    Capture2.PNG
    147.6 KB · Views: 10
  • Capture3.PNG
    Capture3.PNG
    129.6 KB · Views: 9

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Try this version:
VBA Code:
Private Sub Workbook_Open()
    Dim WS As Worksheet
    For Each WS In Sheets(Array("Active", "Archive"))
        With WS
            .Unprotect ""
            .Cells(5, 4).Sort Key1:=.Columns(4), Order1:=xlDescending, Orientation:=xlTopToBottom, Header:=xlYes
            .Protect ""
        End With
    Next WS
    Sheets("Active").Activate
End Sub
Keep in mind that if you have no data such as in the Active sheet, the macro will return an error.
 
Upvote 0
Solution
@mumps I cannot thank you enough, I am so happy, it was starting to make me crazy! ha cheers
now I'm going to play with sending emails from excel thank you
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top