I'm attempting to set a last row for dynamic iteration through a data set and am encountering a bug i've never experienced before. lastRow
is being set to the row before the start of the data for some reason. If the data starts in row 21 it would set lastRow
to 20. brokerLocationInTable
is a range object passed into the function that denotes the location of the broker's name in the data set.
Code Causing error
lastRow = CoverageAndRateSheet.Range("E" & brokerLocationInTable.Row).CurrentRegion.Rows.Count
The data is stored in a slightly odd fashion. The broker name is in column D and immediately adjacent to the name is the list of clients in column E that corresponds to that broker. Once that broker's client list is exhausted there's a blank row and the next broker with his/her corresponding client list begins, which is why i'm using the "control shift down" method rather than iterating upwards from the bottom of the sheet.