Pages • 1
Some Examples of Vba and Subroutine Some Examples of VBA and Subroutines ——————- [email protected] Sub Randomnumbers()x = InputBox(“How many random numbers you want to generate?”)For i = 1 To xRange(“A” & i).Value = WorksheetFunction.RandBetween(1, 400)Next iy = WorksheetFunction.Max(Range(“a1:a” & x))MsgBox (“Max is ” & y)End SubSub clearll()ActiveCell.Select Range(Selection, Selection.End(xlDown)).Select Selection.ClearContentsEnd SubFunction addvalue(XYZ As.