Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
I'm relatively new to VBA and am having problems with some coding. I have a worksheet with many columns of data, and 3 of the columns of data (K, L, M) have formulae that I want to auto-fill down when a user inserts a new row. The formula cells start at row 7, and currently end at cell 145, but this obviously changes when a user deletes or inserts a row. All rows outside this row range (7:145) are going to be locked in a protected sheet, so the inserting and deleting of rows will only occur within this range. There is no problem in the vba code auto-filling down to the end of each column if that's easiest, as the formula in each cell returns "" to the cell if no information in earlier cells is present.<o></o>
<o></o>
Assuming this is easy enough, I am trying to have it so that the coding is automatically run when a new row is inserted - as opposed to having to manually run the macro.<o></o>
<o></o>
It's probably no help, but the code I have produced at the moment is (I replicate this code for the other columns as well, which I know is not efficient code):<o></o>
<o></o>
Sub Fill()
Dim LR As Long
LR = Range("B" & Rows.Count).End(xlUp).Row
Range("k7").AutoFill Destination:=Range("k7" & LR)
End Sub<o></o>
<o></o>
<o></o>
Any help that anyone can provide is very much appreciated.<o></o>
<o></o>
Thanks<o></o>
<o></o>
Bungle<o></o>
<o></o>
I'm relatively new to VBA and am having problems with some coding. I have a worksheet with many columns of data, and 3 of the columns of data (K, L, M) have formulae that I want to auto-fill down when a user inserts a new row. The formula cells start at row 7, and currently end at cell 145, but this obviously changes when a user deletes or inserts a row. All rows outside this row range (7:145) are going to be locked in a protected sheet, so the inserting and deleting of rows will only occur within this range. There is no problem in the vba code auto-filling down to the end of each column if that's easiest, as the formula in each cell returns "" to the cell if no information in earlier cells is present.<o></o>
<o></o>
Assuming this is easy enough, I am trying to have it so that the coding is automatically run when a new row is inserted - as opposed to having to manually run the macro.<o></o>
<o></o>
It's probably no help, but the code I have produced at the moment is (I replicate this code for the other columns as well, which I know is not efficient code):<o></o>
<o></o>
Sub Fill()
Dim LR As Long
LR = Range("B" & Rows.Count).End(xlUp).Row
Range("k7").AutoFill Destination:=Range("k7" & LR)
End Sub<o></o>
<o></o>
<o></o>
Any help that anyone can provide is very much appreciated.<o></o>
<o></o>
Thanks<o></o>
<o></o>
Bungle<o></o>