Hi
I've got a spreadsheet that imports new or updates existing using VBA.
I then have a Sub which copies the formula in row 1 from columns BY to CL then pastes them into the cells from BY5 to CL5 until the bottom of the range that the new data has gone up to (see below).
The new data goes from columns A to AC and columns AD to BX are blank (with titles) - in case we'll need to add data to them, at a later date.
My question is this: when I run the Sub below, it copies the formula correctly and pastes the formulae down, but the formula ALWAYS stops at row 1007 regardless of the amount of data that I import. The current data goes up to row 1139.
Has anyone ever experienced this? Any suggestions on why it doesn't paste all the way down to the end of the range?
PS the offset (,90) part of the code is because the columns that need formulae to be added go up to column 90 (from column A).
Thanks in advance.
I've got a spreadsheet that imports new or updates existing using VBA.
I then have a Sub which copies the formula in row 1 from columns BY to CL then pastes them into the cells from BY5 to CL5 until the bottom of the range that the new data has gone up to (see below).
The new data goes from columns A to AC and columns AD to BX are blank (with titles) - in case we'll need to add data to them, at a later date.
My question is this: when I run the Sub below, it copies the formula correctly and pastes the formulae down, but the formula ALWAYS stops at row 1007 regardless of the amount of data that I import. The current data goes up to row 1139.
Has anyone ever experienced this? Any suggestions on why it doesn't paste all the way down to the end of the range?
PS the offset (,90) part of the code is because the columns that need formulae to be added go up to column 90 (from column A).
Thanks in advance.
Code:
Sub FillFormulae()
Range("BY5:CL5").Copy Range("BY1:CL1")
Range("BY5", Range("A" & Rows.Count).End(xlUp).Offset(, 90)).FillDown
End Sub