Skip to content

Instantly share code, notes, and snippets.

View faeem81's full-sized avatar

Mohamed Faeem Lashkaria faeem81

View GitHub Profile
@faeem81
faeem81 / VBA UCase Function
Created December 1, 2022 16:00
How to Use VBA UCase Function
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Z As Long
Dim xVal As String
On Error Resume Next
If Intersect(Target, Range("C8:C100")) Is Nothing Then Exit Sub
@faeem81
faeem81 / RNG
Created August 22, 2021 11:49
Random Number Generator
Public Sub generateRandNum()
'Define your variabiles
lowerbound = Range("D22")
upperbound = Range("F22")
Set randomrange = Range("B24:F43")
randomrange.ClearContents
For Each rng1 In randomrange
counter = counter + 1
Next
@faeem81
faeem81 / SpellNumber No Currency
Created July 8, 2021 08:23
SpellNumber Without Currency
Option Explicit
'Main Function
Function SpellNumberWC(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
@faeem81
faeem81 / SpellNumber
Last active July 8, 2021 14:00
SpellNumber Function US Dollars, Canadian Dollars, Australian Dollars, UK Pounds, Euros, Japanese Yen, South African Rand, UAE Dirhams, Saudi Riyals, Thai Baht & Sri Lankan Rupee
Option Explicit
'Main Function www.MSOfficeGeek.com
Function SpellNumber(ByVal MyNumber, Optional MyCurrency As String = "")
Dim Dollars, cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
@faeem81
faeem81 / SpellNumber2
Last active July 8, 2021 06:42
SpellNumber Function Indian Rupees, Pakistani Rupees, and Bangladeshi Taka
Option Explicit
'Main Function www.MSOfficeGeek.com
Function SpellNumber2(ByVal MyNumber, Optional MyCurrency As String = "")
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count, x
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Lacs "
Place(4) = " Crores "
Place(5) = " Hundred Crores "
@faeem81
faeem81 / SpellNumberINR
Created March 11, 2021 08:04
SpellNumber Indian Rupees - Google Sheet
/**
* msofficegeek.com Spell Number Indian Rupees
* @customfunction
*/
function SpellNumberINR(input) {
const rupees = Number(parseInt(input, 10));
const output = [];
if (rupees === 0) {
output.push("zero");