Afternoon
Unfortunately the code did not work for me, in my situation
However, a bit more digging found a different way to do it:
'fill data series column
Application.ScreenUpdating = True
Dim sht As Worksheet
Dim firstCell As Range, lastCell As Range
Dim fillRange As Range, cell As Range
Dim lastRow As Long, firstRow As Long
Dim fillCol As String
Set sht = ThisWorkbook.Worksheets("raw data")
lastRow = lr 'the row of the last cell you want to fill
firstRow = 2 'the row where your data begins
fillCol = "L" 'the column to be filled
Set firstCell = sht.Range(fillCol & firstRow)
While firstCell.Row <> lastRow
If firstCell.End(xlDown).Row > lastRow Then
Set lastCell = sht.Range(fillCol & lastRow)
Else
Set lastCell = firstCell.End(xlDown)
End If
sht.Range(firstCell, lastCell).DataSeries Type:=xlLinear, Trend:=True
Set firstCell = lastCell
Wend
in this example, my last line is LR in initial macro,or could be entered as a manual value.
the above macro used a CTRL + Down arrow type 'search' to jump between the values i want to fill between. I therefore had to change the format of my 'fill' column after a paste, and while its not the most elegant solution, I used a record macros, text to columns code to do this:
Selection.TextToColumns Destination:=Range("L2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
always fun how there are so many different ways to do things - anyways thanks for the help
Gareth
Bookmarks