Please explain this macro for me..please kindly, thank you!

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
:)In the code below i want a few clarification...

#1. does i as long means that i col A?

and below that is writen for i = 512 to 1 step -1; does this means it will go till row 512 of col A
and #2. what does to 1 step -1 mean?

#3. with cells(i,1); what is tis supose to do?

Please help...and explain this..thanks alot!
I'm learning all this from you guys thanks alot!

Sub exa1()
Dim i As Long

For i = 512 To 1 Step -1
With Cells(i, 1)
If Len(.Value) Then .Offset(1).Resize(4).EntireRow.Delete
End With
Next
End Sub
 

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).
Does this help?

Code:
Sub exa1()
Dim i As Long ' declares i as a long integer (can hold values from -2,147,483,648 to 2,147,483,647)
For i = 512 To 1 Step -1 ' loop backwards freom row 512 to row 1, one row at a time
    With Cells(i, 1) ' cells(i,1) means A1 when i = 1, A2 when i = 2 and so on
        If Len(.Value) Then .Offset(1).Resize(4).EntireRow.Delete
    End With
Next
End Sub
 
Upvote 0
:nya:;)Cheers to Vog!!!

And to who so ever created this site and So called amazing helpfull BOARD..


Great Thanks!!!
 
Upvote 0
Yes that is correct...i'm learning from everywhere possible.

Vog~! Thanks alot once for all your help....;)
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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