'Find out how many days forward or backward to locate dates.
For lRow = 1 To 10
'Look at 1st column in each row to see if it matches sPeriod
' sPeriod = ComboBox_Period.Value
If Sheets("LOVs").Cells(lRow, 1).Value = sPeriod Then
'found the row that matched sPeriod
' so take the value from 2nd column
iDays = Sheets("LOVs").Cells(lRow, 2).Value
End If
Next lRow
'Common method to find last cell in column A that has a value
' Range("A" & Rows.Count) is same as Range("A1048576")
' .End(xlUp) is the same as clicking {End}{Up} from Range("A1048576")
' finds last cell with a value in it
With shDates.Range("A" & Rows.Count).End(xlUp)
'put row # into variable
lDatesNextRow = .Row
If .Value <> "" Then
'Only way that .Value = ""
' is if the entire column was empty,
' so the cell should always have something in it,
' so take the next row
'
'If for some reason the entire column was empty
' then this line would not execute
' and leave lDatesNextRow as Row(1)
lDatesNextRow = .Row + 1
End If
End With
Let me know how I did at explaining things.
Bookmarks