see attached file, I presume you need to concatenate VB module inserted into a book and paste this code, published in this forum, I do not remember author
who is the creator .... we appreciate it!
Sub Delete_Rows()
Dim rng As Range, counter As Integer
Set rng = Sheets(1).Range("A1")
counter = 1
Do While rng.Value <> ""
If InStr(1, rng.Value, " ") <> 0 Then
If IsNumeric(Left(Trim(rng.Value), InStr(1, Trim(rng.Value), " ",
vbTextCompare) - 1)) Then
If CInt(Left(Trim(rng.Value), InStr(1, Trim(rng.Value), " ",
vbTextCompare) - 1)) = counter Then
counter = counter + 1
Else
Set rng = rng.Offset(-1, 0)
rng.Offset(1, 0).EntireRow.Delete
End If
Else
Set rng = rng.Offset(-1, 0)
rng.Offset(1, 0).EntireRow.Delete
End If
Else
Set rng = rng.Offset(-1, 0)
rng.Offset(1, 0).EntireRow.Delete
End If
Set rng = rng.Offset(1, 0)
Loop
End Sub
chilexcel
2011/3/10 ChilExcel <[email protected]>
>
>
> you need to do?
>
>
>
> Chilexcel
>
>
>
>
> 2011/3/10 Cesar Delanoval <[email protected]>
>
> I am sending you the sample file that goes my latest post since I was not
>> able to attach it or upload it on the group website.
>> I appreciate all your help
>> Thanks
>>
>> --
>>
>> ----------------------------------------------------------------------------------
>> Some important links for excel users:
>> 1. Follow us on TWITTER for tips tricks and links :
>> http://twitter.com/exceldailytip
>> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>
>> To post to this group, send email to [email protected]
>>
>> <><><><><><><><><><><><><><><><><><><><><><>
>> Like our page on facebook , Just follow below link
>> http://www.facebook.com/discussexcel
>>
>
>
>
> --
> Visita ; http://sites.google.com/site/chilexcel/Home
> Visita ; http://www.youtube.com/user/timextag41
>
>
--
Visita ; http://sites.google.com/site/chilexcel/Home
Visita ; http://www.youtube.com/user/timextag41
--
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links :
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
To post to this group, send email to [email protected]
<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel
Extract-Address_usingConcatenate.xls
Description: MS-Excel spreadsheet
