Originally Posted by dinesh
A note on why I need to release a new version almost every time the Mutilate or Combat sheets are updated: basically, it's for one thing, the Estimated DPS calculation. It's listed at the top of the mutilate and combat sheets, and if you click in that cell you'll see it's a reference to the respective Calculation sheet. Unfortunately, the row number for this calculation often changes from sheet to sheet. Updating the row number is something you have to then do in MY companion sheet, so that we can go to the right place to get the DPS.
|
Application.WorksheetFunction.Match("Total Damage", Excel.Workbooks(BookName).Worksheets(CalcSheetName).Range("A:A"), 0)
Use this code in your Companion sheet to make it future proof via having it search the relevant Calcs sheet for "Total Damage" and return it's row number, provided Aldriana doesn't change the wording in future versions of his sheets.
You'll have to rework some of your code to implement it, but I ran several tests on my end and it correctly returns the row which holds the total DPS value.
Here's an example of it being used for copying the DPS:
Sub CopyDPS()
If Worksheets("Gear Upgrades").Spec.Value = "Combat" Then
BookName = Worksheets("Options").Cells(3, 3)
DPSCellRow = Application.WorksheetFunction.Match("Total Damage", Excel.Workbooks(BookName).Worksheets(CalcSheetName).Range("A:A"), 0)
Worksheets("Options").Cells(8, 3).Value = Application.Round(Excel.Workbooks(BookName).Worksheets(CalcSheetName).Cells(DPSCellRow, CombatDPSCellColumn), 2)
ElseIf Worksheets("Gear Upgrades").Spec.Value = "Mutilate" Then
BookName = Worksheets("Options").Cells(4, 3)
DPSCellRow = Application.WorksheetFunction.Match("Total Damage", Excel.Workbooks(BookName).Worksheets(CalcSheetName).Range("A:A"), 0)
Worksheets("Options").Cells(8, 3).Value = Application.Round(Excel.Workbooks(BookName).Worksheets(CalcSheetName).Cells(DPSCellRow, MutiDPSCellColumn), 2)
End If
End Sub