Hi,
I want a code that will delete the entire duplicate row based on Column F also the linked pages under column L if any.
Thanks in advance.
Hi,
I want a code that will delete the entire duplicate row based on Column F also the linked pages under column L if any.
Thanks in advance.
Last edited by fatalcore; 02-04-2012 at 12:14 PM.
Hi Fatalcore,
Try this code for your button
Cheers, Rob.
![]()
Private Sub CommandButton2_Click() Dim cel As Range, vresult As Variant, iCount As Integer, hl As Hyperlink For Each cel In Intersect(Range("F:F"), ActiveSheet.UsedRange).Cells If cel.Row > 2 Then vresult = Application.VLookup(cel.Text, Range("f1", cel.Offset(-1, 0)), 1, 0) End If If IsError(vresult) = False And cel <> "" Then For Each hl In ActiveSheet.Hyperlinks If hl.Range.Row = cel.Row Then Application.DisplayAlerts = False Sheets(Mid(hl.SubAddress, 2, InStr(hl.SubAddress, "!") - 3)).Delete Application.DisplayAlerts = True Exit For End If Next hl cel.MergeArea.Rows.EntireRow.Delete End If Next cel End Sub
Hi Rob,
The code didn't solve my problem. I just want the duplicate rows to be deleted and the linked sheets but instead it deleted other lines too. When I re run the code it deleted the existing rows also, however the linked pages never got deleted.
Please help me out.
Thanks in advance.
hi fatalcore, option, check attachment
delete duplicate rows - all rows having duplicates deleted
Hi Watersev,
I don't want all rows having duplicated to be deleted. What I want is say Tests are like this > A,A,A,B,B,B,B,C,C,A,A,C,B then I want rows only A,B,C, will be there others deleted.
Thanks in advance.
it was not clear from your original post, check attachment
Hi watersev,
Thanks for the code, but I am facing some problem when I am using it in my original file. The duplicate lines are perfectly deleting,but the hyperlinked files are not getting deleted.
I am basically using another code to generate the hyperlink sheets. When I am placing the mouse over these links in my original file. The pop up box is showing like this :Can you please help,#'1 - xyz'!A1
Thanks in advance.
try to change this:
to this![]()
Sheets(Split(hplink(1).SubAddress, "'")(1)).Delete
![]()
Sheets(Split(Split(hplink(1).SubAddress, "#'")(1), "'")(0)).Delete
Last edited by watersev; 02-04-2012 at 08:33 AM.
or another substitution option to the post above:
![]()
Sheets(Split(Replace(Replace(hplink(1).SubAddress, "#", ""), "'", ""), "!")(0)).delete
Hi watersev,
I tried the above two options it didn't work.
Here is the sample file, When you click the button Create Link, the sheets will be generated.
Thanks in advance.
Last edited by fatalcore; 02-04-2012 at 12:12 PM.
please check attachment
Hi watersev,
Thanks mate, You solved it !!! Godbless...
I've revised the code and removed some redundant parts, I would suggest to use this option instead of the one offered in post #11
Last edited by watersev; 02-04-2012 at 03:28 PM.
Thanks watersev, It's brilliant. Godbless !!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks