-
Jan 27th, 2021, 12:18 PM
#1
Thread Starter
New Member
[RESOLVED] how to copy some formulas to selected rows
Hi,
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 Book1.zipO2: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.
-
Jan 27th, 2021, 03:09 PM
#2
Re: how to copy some formulas to selected rows
you can test this to see if it works how you want
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
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
-
Jan 28th, 2021, 10:41 AM
#3
Thread Starter
New Member
Re: how to copy some formulas to selected rows
thank you very much westconn1, your code solved my problem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|