RoE Development > RoE PbeM Whiteboard

Excel Macros


X-Osoerde (Alan):
Hey Bjorn, How would you like some excel VBA macros to do some of the excel work in the P&H?  For the most part, it will could help make the sheet somewhat more straightforward...

For instances...

--- Quote ---Public Function HoldingIncome(ProvinceLevel As Single, IncomeModifier As Single, HoldingLevel As Single, TotalLawLevels As Single, Tax As String, Prosperity As String) As Single
        Dim TaxInt As Single
        Dim ProsperityInt As Single
        Dim Income As Single
            Select Case Tax
                Case Is = "No"
                    TaxInt = 0
                Case Is = "Light"
                    TaxInt = 0.2
                Case Is = Fair
                    TaxInt = 0.3
                Case Is = "Moderate"
                    TaxInt = 0.4
                Case Is = "Heavy"
                    TaxInt = 0.5
                Case Is = "Severe"
                    TaxInt = 0.6
                Case Is = "Crippling"
                    TaxInt = 0.8
                Case Is = "Total"
                    TaxInt = 1
            End Select
            Select Case Prosperity
                Case Is = "Rebellious"
                    ProsperityInt = 0
                Case Is = "Defiant"
                    ProsperityInt = 0.25
                Case Is = "Turbulent"
                    ProsperityInt = 0.5
                Case Is = "Poor"
                    ProsperityInt = 0.75
                Case Is = "Unsteady"
                    ProsperityInt = 0.9
                Case Is = "Guarded"
                    ProsperityInt = 0.95
                Case Is = "Average"
                    ProsperityInt = 1
                Case Is = "Steady"
                    ProsperityInt = 1.05
                Case Is = "Content"
                    ProsperityInt = 1.1
                Case Is = "Healthy"
                    ProsperityInt = 1.15
                Case Is = "Prosperous"
                    ProsperityInt = 1.2
                Case Is = "Thriving"
                    ProsperityInt = 1.25
                Case Is = "Ideal"
                    ProsperityInt = 1.35
                Case Is = "Utopian"
                    ProsperityInt = 1.5
            End Select
    Income = HoldingLevel * (ProvinceLevel / IncomeModifier) * (1 - (TaxInt * (TotalLawLevels / ProvinceLevel))) * ProsperityInt
    HoldingIncome = Application.Round(Income, 1)
End Function
--- End quote ---

The above function takes the following parameters (in this order):
Province Level = The Province level the holding is in.
Income Modifier = Usually holdings produce the province level/5 in GB per level, this parameter controls the '5' thereby increasing or decresing the base income each holding level generates.
Holding Level = the holding level
TotalLawLevels = the total number of law levels controlled in the province
Tax = the tax level (as text/string)
Prosperity  = the prosperity level (as text/string)

This function only works for NON-LAW holdings, I will create a function for law holdings.

Most of the functions in RoE are not complicated perse and all can be turned into either custom functions and/or sub procedures which could potentially reduce the work in maintaining the sheets...

X-MOC/Leman States (Even):
What we really need is a macro that can read the domain orders and adjust the holding and prosperity levels according to successcul rule, contest and agitate actions...

X-LPA/Gaerred Khaiarén (Gray):
Grrrr....I said the same thing. It would be totally doable if all the data were organized like a database. It is probably doable now, but it would be very difficult I think...


[0] Message Index

Go to full version