Lostgrave2001
New Member
- Joined
- May 15, 2015
- Messages
- 3
Hello </SPAN>
I would appreciate any help provided </SPAN>
I currently have a spreadsheet with a table in that has the refs in column A (D0001=A11 – D0040= A50) I have the below macro that will insert another 10 blank rows in.</SPAN>
“Sub Insert_New_Rows()</SPAN>
For i = 1 To 10</SPAN>
Dim Lr As Integer, Fr As Integer</SPAN>
Fr = Columns("A").Find(What:="Ref", After:=Range("A10")).Row 'Searching row of "Ref" header</SPAN>
Lr = Range("A" & Fr).End(xlDown).Row 'Searching last row in Risk table</SPAN>
Rows(Lr + 1).Insert Shift:=xlDown 'Inserting new row</SPAN>
Rows(Lr).Copy 'Copying format of last row</SPAN>
Rows(Lr + 1).PasteSpecial Paste:=xlPasteFormats 'Pasting format to new row</SPAN>
Application.CutCopyMode = False 'Deactivating copy mode</SPAN>
Cells(Lr + 1, "B").Select</SPAN>
Next</SPAN>
End Sub</SPAN>
What I also wonder if it is possible for the Macro to auto fill the cells in column A so A51 =D0041 – A60 = D0060 I will need the macro to be able to add another & fill another 10 lines every time I click the button.</SPAN>
On another note I noticed that my total formula doesn’t update as I add more rows in the spread sheet could you please advise me on this as well. </SPAN>
=IF(COUNTIF(D11:D50,"Y")+COUNTIF(D11:D50,"N")=0," ",INT(((COUNTIF(D11:D50,"Y")/(COUNTIF(D11:D50,"Y")+COUNTIF(D11:D50,"N")))*100)+0.5))</SPAN>
Thanks in advance</SPAN>
Chris </SPAN>
I would appreciate any help provided </SPAN>
I currently have a spreadsheet with a table in that has the refs in column A (D0001=A11 – D0040= A50) I have the below macro that will insert another 10 blank rows in.</SPAN>
“Sub Insert_New_Rows()</SPAN>
For i = 1 To 10</SPAN>
Dim Lr As Integer, Fr As Integer</SPAN>
Fr = Columns("A").Find(What:="Ref", After:=Range("A10")).Row 'Searching row of "Ref" header</SPAN>
Lr = Range("A" & Fr).End(xlDown).Row 'Searching last row in Risk table</SPAN>
Rows(Lr + 1).Insert Shift:=xlDown 'Inserting new row</SPAN>
Rows(Lr).Copy 'Copying format of last row</SPAN>
Rows(Lr + 1).PasteSpecial Paste:=xlPasteFormats 'Pasting format to new row</SPAN>
Application.CutCopyMode = False 'Deactivating copy mode</SPAN>
Cells(Lr + 1, "B").Select</SPAN>
Next</SPAN>
End Sub</SPAN>
What I also wonder if it is possible for the Macro to auto fill the cells in column A so A51 =D0041 – A60 = D0060 I will need the macro to be able to add another & fill another 10 lines every time I click the button.</SPAN>
On another note I noticed that my total formula doesn’t update as I add more rows in the spread sheet could you please advise me on this as well. </SPAN>
=IF(COUNTIF(D11:D50,"Y")+COUNTIF(D11:D50,"N")=0," ",INT(((COUNTIF(D11:D50,"Y")/(COUNTIF(D11:D50,"Y")+COUNTIF(D11:D50,"N")))*100)+0.5))</SPAN>
Thanks in advance</SPAN>
Chris </SPAN>