Script help!!

HowlingMadMurdock

New Member
Joined
Mar 9, 2016
Messages
1
Hello,

I am working on a script for the company I work for. In short, I am running a report that shows how many days are left for each user (max is 100) and when the user is down to 10 days or less, they will receive an email warning them that they only have 10 days left. I am horrible when it comes to scripting and have limped my way through what I have now but it works. I will share what I completed so far, hopefully someone can help. Thank you

Sub delete_unused_information()
' Delete uneeded information
Range("A:A,C:C,D:D").Select
Selection.Delete Shift:=xlToLeft
'PURPOSE: Deletes single cells that are blank located inside a designated range
Dim rng As Range
Set rng = Range("A1:A300:B1:B300:C1:C300").SpecialCells(xlCellTypeBlanks)
rng.Rows.Delete Shift:=xlShiftUp
'Insert formula into each row.
Range("K2").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Selection.AutoFill Destination:=Range("K2:K250"), Type:=xlFillDefault
Range("K2:K250").Select
Dim strFormulas(1 To 3) As Variant
With ThisWorkbook.Sheets("download_18659668")
strFormulas(1) = "=SUM(B2+100)"
strFormulas(2) = "=MIN(C2-K2)"
.Range("C2").Formula = strFormulas(1)
.Range("C2:C245").FillDown
.Range("D2").Formula = strFormulas(2)
.Range("D2:D245").FillDown
End With
'Hide Column
Columns("K:K").Select
Selection.EntireColumn.Hidden = True
'Change column to number format
Columns("D:D").Select
Selection.NumberFormat = "0"
'Add cell description and autofit columns
Range("C1").Select
ActiveCell.FormulaR1C1 = "When 100 days ends"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Number of Days Left"
Columns("A:D").Select
Columns("A:D").EntireColumn.AutoFit


End Sub
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,708
Messages
5,833,245
Members
430,200
Latest member
ADLHMA2022

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
Top