Forum Discussion
khjhzw
Mar 10, 2022Copper Contributor
How to insert (or create) new rows under every row that meets a certain condition?
Hello, Thank you for reading my question. Could you please help me with this task? I have to do a repetitive task with a quite a large excel worksheet (or table). I am wondering if there is w...
- Mar 10, 2022
Sub insertrow() Dim i As Integer Dim j As Integer For i = 1 To 1000 j = InStr(1, Cells(i, 1), "chapter", vbTextCompare) If j = 1 Then Cells(i + 1, 1).EntireRow.Insert Cells(i + 2, 1).EntireRow.Insert Cells(i + 1, 2).Value = "word count" Cells(i + 2, 2).Value = "date started" i = i + 2 Else End If Next i End SubMaybe with these lines of code. Click the button in cell E1 in the attached file to start the macro.
mrgcav
Oct 20, 2023Copper Contributor
Similar to what I need.
I have a form with 10 rows and columns A-Z (26). Some files have less than 10 entries. Some files have more than 10 entries. All cells have a formula with in them.
I do not know VBA but I Need a simple macro to add another row (row 11)when Cells 10A and 10B and 10C all have data. so by the time I fill in 10Z there is a row 11 and the cells in row 11 have a incremented formula.
w
peiyezhu
Oct 21, 2023Bronze Contributor
If you create a new thread and upload your file for a new question,I guess new discussion can start soon.