Good morning guys.
Right now I have a macro to add 20% of a cell value (or a range of values) to that specific cell(s).
It goes like this:
Sub Multiplyby1point2()
Dim ws As Worksheet
Dim rngSel As Range
Dim Num As Double
Dim i As Long
Dim j As Long
Dim lRows As Long
Dim lCols As Long
Dim Arr() As Variant
Set rngSel = Selection
lRows = rngSel.Rows.Count
lCols = rngSel.Columns.Count
Num = 1.2
If rngSel.Count = 1 Then
rngSel = rngSel * Num
Else
Arr = rngSel
For i = 1 To lRows
For j = 1 To lCols
Arr(i, j) = Arr(i, j) * Num
Next j
Next i
rngSel.Value = Arr
End If
End Sub
I can obviously create a bunch of different macros so people can choose from in order to process something like apply a tax rates or a tariff fee addition:
suZfu96.png
But would you please help me if I can streamline it all and perhaps use a form plus a model so that users can simply select the "label" - and then the constant alongside with the arithmetic operations will be applied to the selected value(s)?
Thanks very much, I am still trying to familiarize myself with these basic concepts so it is a struggle at the beginning.
Bookmarks