' 1. AutoFill Column with Formula: Sub AutoFillFormula() Dim lastRow As Long lastRow = Cells(Rows.Count, "A").End(xlUp).Row Range("B2:B" & lastRow).Formula = "=A2*2" ' Change the formula as needed End Sub '2. Remove Duplicates: Sub RemoveDuplicates() Columns("A:A").RemoveDuplicates Columns:=1, Header:=xlYes ' Change column as needed End Sub '3. Filter Data and Copy to New Sheet: Sub FilterAndCopy() Dim wsSource As Worksheet, wsTarget As Worksheet Set wsSource = ThisWorkbook.Worksheets("Sheet1") ' Change source sheet name Set wsTarget = ThisWorkbook.Worksheets("Sheet2") ' Change target sheet name wsSource.Range("A1:D10").AutoFilter Field:=1, Criteria1:="Category1" ' Change criteria and range as needed wsSource.Range("A2:D10").SpecialCells(xlCellTypeVisible).Copy wsTarget.Range("A1") ' Change range as needed wsSource.AutoFilterMode = False End Sub '4. Export Worksheet as PDF: Sub ExportAsPDF() Dim filePath As String filePath = "C:\Folder\FileName.pdf" ' Change file path and name as needed ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=filePath, Quality:=xlQualityStandard End Sub '5. Generate Random Numbers: Sub GenerateRandomNumbers() Dim rng As Range, cell As Range Set rng = Range("A1:A10") ' Change range as needed For Each cell In rng cell.Value = Int((100 - 1 + 1) * Rnd + 1) ' Generate random number between 1 and 100 Next cell End Sub