I've written the function below that I would like to use dynamically in my excel sheet where the function would assess the value of the variable selected in the formula and based on that value, perform a simple calculation referencing values in cells in different columns but in the same row.

I've written the function below that I would like to use dynamically in my excel sheet where the function would assess the value of the variable selected in the formula and based on that value, perform a simple calculation referencing values in cells in different columns but in the same row.

I know that the code below works, but how can I rewrite the ranges so that my function can be used dynamically for each row of the same column?

Function AddedValue(TabSize As Integer)Select Case TabSize

`Case 2 AddedValue = Range("K3") * (Range("N3") * (Range("H3") * 0.001)) Case 4 AddedValue = Range("K3") * (Range("O3") * (Range("H3") * 0.001)) Case 6 AddedValue = Range("K3") * (Range("P3") * (Range("H3") * 0.001)) Case 8 AddedValue = Range("K3") * (Range("Q3") * (Range("H3") * 0.001)) Case 10 AddedValue = Range("K3") * (Range("R3") * (Range("H3") * 0.001))`

End Select End Function

When my coworkers and I discussed backend technologies for an upcoming project, someone jokingly mentioned Excel as people widely misused it as a terrible database replacement. Although we settled for .NET, the idea of using Excel as a backend fascinated me. Since I just recently finished my bachelor's thesis and had some spare time, I thought I'd give it a shot and see how far I'd get.

![VBAMaterial-Color-Palette-BG](https://i.ibb.co/DwbX8NL/VBAMaterial-Color-Palette-BG.png "VBAMaterial-Color-Palette-BG") Hello there, this article is about how to get Material Color Palette [https://material.io/guidelines/style/color.html#] into...

I have a table that contains a set of bundles that have to be broken down into their components. For this I'm looking for VBA instructions that will copy any row that contains the tag "-edubnd" at the end of the 'sku' cell (please see table bellow for example) twice underneath itself.