I need a little help in finding a better solution. In the screen shot below any change to the forecast line I need to find the value in column B. The screen shot is only a sample in my production sheet the row count is currently 4200.
Column A Col B Col C Col D Col E
Row 5 January
Row 6 Prg Desc SD FG GH DF
Row 7 Forecast 1 2 3 4
Row 8 Actual
Row 9 Compare
My current code does what I need it to, however, I'm sure there is a better method of accomplish my goal. In my production sheet the value in B is in row 5.
CurMonth = target.Offset(5 - target.Row).Value
If CurMonth = "" Then
CurMonth = target.Offset((5 - target.Row), -1).Value
If CurMonth = "" Then
CurMonth = target.Offset((5 - target.Row), -2).Value
If CurMonth = "" Then
CurMonth = target.Offset((5 - target.Row), -3).Value
End If
End If
End If
Debug.Print CurMonth
Any suggestions would be very appreciated.