More than one value

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
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I think you will have more luck if you instead show us a data example, and explain exactly what you want to happen.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top