Davidm1963
New Member
- Joined
- Jan 30, 2016
- Messages
- 6
I been using this macro now for some time and its been working well however I now need to move the entire row dependant on more than one value in colounm B how do I add an additional value
Dim i As Long
Dim j As Long
Dim Lastrow As Long
Dim nxt As Long
Sheets("Cash").Activate
Lastrow = Sheets("Master").Range("A" & Rows.Count).End(xlUp).Row
Sheets("Cash").Range("A2:Q10000").ClearContents
For i = 2 To Lastrow
If Sheets("Master").Cells(i, "B").Value = "Cash Account" Then
nxt = Sheets("Cash").Range("B" & Rows.Count).End(xlUp).Row + 1
For j = 1 To 16
Sheets("Cash").Cells(nxt, j) = Sheets("Master").Cells(i, j)
Range("Q" & nxt).Formula = "=SUM(" & Range("Q" & nxt - 1).Address(0, 0) & "-" & _
Range("F" & nxt).Address(0, 0) & "+" & Range("J" & nxt).Address(0, 0) & ")"
Next j
End If
Next i
Dim i As Long
Dim j As Long
Dim Lastrow As Long
Dim nxt As Long
Sheets("Cash").Activate
Lastrow = Sheets("Master").Range("A" & Rows.Count).End(xlUp).Row
Sheets("Cash").Range("A2:Q10000").ClearContents
For i = 2 To Lastrow
If Sheets("Master").Cells(i, "B").Value = "Cash Account" Then
nxt = Sheets("Cash").Range("B" & Rows.Count).End(xlUp).Row + 1
For j = 1 To 16
Sheets("Cash").Cells(nxt, j) = Sheets("Master").Cells(i, j)
Range("Q" & nxt).Formula = "=SUM(" & Range("Q" & nxt - 1).Address(0, 0) & "-" & _
Range("F" & nxt).Address(0, 0) & "+" & Range("J" & nxt).Address(0, 0) & ")"
Next j
End If
Next i