Help please!
This is a tiny chunk of a couple pages of code... I didn't write it, I'm just trying to edit it according to my boss' specifications so it will run faster. Anyways, so I've defined First Year Premium and First Year Premium Prior below, and the macro works up to that point. I want to define cell E3 (k=3 at this point) as the difference between FYPrem (current YTD) and FYPremP (Previous YTD) so I can find the current quarter to date data. Currently, the data that is being pulled for FYPrem is negative and FYPremP is positive...
I'm getting run-time error 1004: application-defined or object-defined error. How do I fix this??
FYPrem = "" & Worksheets(TabNames(3)).Name & "!" & Cells(13 + i, 9).Address
FYPremP = "" & Worksheets(TabNames(8)).Name & "!" & Cells(k, 5).Address
Worksheets(TabNames(5)).Range("E" & k) = "=-" & (FYPrem + FYPremP)
I'm really new to VBA... So if you could explain your answer really well, that would be amazing. I don't really want to just copy/paste whatever solution you find without understanding it.
THANK YOU.
***Edit: I can give more code as a context if that helps, I just need to edit some of it because some of the names in the code are confidential...
Bookmarks