We are adding some formula manualy but now we have large data around 1200 and want help to do it with vba or code
We are putting the Text Max in N2 and formula in O2:Q2 (All formula are different)
and after that We are putting the Text Min in N3 and formula O3:Q3 (All formula are different)
All the above work we are doing in N8, N14 and all other.
Get the below Code from westconn1
HTML Code:
lr = Cells(Rows.Count, 1).End(xlUp).Row
For rw = 2 To lr Step 6
With Cells(rw, 14)
.Value = "Max"
.Offset(1) = "Min"
.Offset(, 1).Formula = "=Max(F" & rw & ":F" & rw + 4 & ")"
.Offset(1, 1).Formula = "=Min(F" & rw & ":F" & rw + 4 & ")"
End With
Next
want to add some more formula in next column
In Column P2 =Roundup(O2)
In Column P3 =ROUNDDOWN(O3)
Re: how to copy some formulas to selected rows NEW
did you have a go yourself? workout the difference in offset and the formula string would be quite similar
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: how to copy some formulas to selected rows NEW
well done
i just did the formula as you posted, i should have checked the parameters for the function
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete