Multiply all the Values by a Number
Sub addNumber() Dim rng As Range Dim i As Integer i = InputBox(“Enter number to multiple”, “Input Required”) For Each rng In Selection If WorksheetFunction.IsNumber(rng)
Sub addNumber() Dim rng As Range Dim i As Integer i = InputBox(“Enter number to multiple”, “Input Required”) For Each rng In Selection If WorksheetFunction.IsNumber(rng)
Sub removeTime() Dim Rng As Range For Each Rng In Selection If IsDate(Rng) = True Then Rng.Value = VBA.Int(Rng.Value) End If Next Selection.NumberFormat = “dd-mmm-yy”
Sub convertLowerCase() Dim Rng As Range For Each Rng In Selection If Application.WorksheetFunction.IsText(Rng) Then Rng.Value= LCase(Rng) End If Next End Sub This code will help
Sub removeChar() Dim Rng As Range Dim rc As String rc = InputBox(“Character(s) to Replace”, “Enter Value”) For Each Rng In Selection Selection.Replace What:=rc, Replacement:=””
Sub convertUpperCase() Dim Rng As Range For Each Rng In Selection If Application.WorksheetFunction.IsText(Rng) Then Rng.Value = UCase(Rng) End If Next End Sub VBA Macro code
Sub convertProperCase() Dim Rng As Range For Each Rng In Selection If WorksheetFunction.IsText(Rng) Then Rng.Value = WorksheetFunction.Proper(Rng.Value) End If Next End Sub And this code
Sub date2year() Dim tempCell As Range Selection.Value = Selection.Value For Each tempCell In Selection If IsDate(tempCell) = True Then With tempCell .Value = Year(tempCell) .NumberFormat
Sub removeDate() Dim Rng As Range For Each Rng In Selection If IsDate(Rng) = True Then Rng.Value = Rng.Value – VBA.Fix(Rng.Value) End If NextSelection.NumberFormat =
Sub replaceBlankWithZero() Dim rng As Range Selection.Value = Selection.Value For Each rng In Selection If rng = “” Or rng = ” ” Then rng.Value
Sub convertTextCase() Dim Rng As Range For Each Rng In Selection If WorksheetFunction.IsText(Rng) Then Rng.Value = UCase(Left(Rng, 1)) & LCase(Right(Rng, Len(Rng) – 1)) End If
Sub removeNegativeSign() Dim rng As Range Selection.Value = Selection.Value For Each rng In Selection If WorksheetFunction.IsNumber(rng) Then rng.Value = Abs(rng) End If Next rng Remove
Sub convertToNumbers() Dim rng As Range Selection.Value = Selection.Value For Each rng In Selection If Not WorksheetFunction.IsNonText(rng) Then rng.Value = WorksheetFunction.Arabic(rng) End If Next rng
Welcome to Excel Templates – your ultimate destination for all things related to Excel! We pride ourselves on being a comprehensive, 100% free platform dedicated to providing top-notch, easily editable Excel templates, step-by-step tutorials, and useful macro codes. With fresh templates uploaded daily, we aim to meet every conceivable Excel need you may have. Whether you’re a student, a business professional, or someone looking to make sense of their data, our range of templates has you covered. Dive into the world of Excel Templates today and transform your number-crunching experience into an effortless journey of discovery and efficiency. Join our growing community and elevate your Excel game now.
© 2023 xlsxtemplates all rights reserved