Extract Data

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,603
Office Version
  1. 2021
Platform
  1. Windows
I have data in Col A to Z on Sheet 3 and values in Col O


I would a macro to extract data from Col A:Z from row2 onwards the values in Col O add up to approximately 1,000,000 and paste these on Sheet4 from row2 onwards



Your assistance in this regard is most appreciated
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
TRY these codes
Sub howard()
Dim x As Integer, a As Integer, b As Integer
x = Cells(Rows.Count, 1).End(xlUp).Row
b = 0
For a = 2 To x
b = b + Cells(a, "O")
If b >= "1000000" Then
Sheets("sheet1").Range("A2:Z" & a).Copy
Sheets("sheet4").Range("A2").PasteSpecial
End If
Next a
MsgBox "complete"
end sub
ravi shankar
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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