Meldoc code explaination. for Experts. Help!!!!

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
;)Meldoc prepapred this code:
Please expplain how this code works each line. Thanks alot!!!



Sub Pedie()
With Sheet1
lr = .Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lr
If .Cells(i, "D").Value >= .Cells(2, "H").Value Then
.Range("A" & i & ":G" & lr).Copy Sheets("Home").Range("A1")
Exit For
End If
Next i
End With
End Sub
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
What exactly do you not understand?

I don't really understand what this code is meant to do since it copies everything to A1. Don't you want it copied to the next free row?
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,796
Members
449,337
Latest member
BBV123

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