Hiii Guys,,,
i need to run a macro in all the sheets in the workbook except the first sheet.
this is my macro
Sub DelDupRows()
Dim rngSrc As Range
Dim NumRows As Integer
Dim ThisRow As Integer
Dim ThatRow As Integer
Dim ThisCol As Integer
Dim RightCol As Integer
Dim J As Integer, K As Integer
Application.ScreenUpdating = False
Set rngSrc = ActiveSheet.Range(ActiveWindow.Selection.Address)
NumRows = rngSrc.Rows.Count
ThisRow = rngSrc.Row
ThatRow = ThisRow + NumRows - 1
ThisCol = rngSrc.Column
RightCol = ThisCol + rngSrc.Columns.Count - 1
'Start wiping out duplicates
For J = ThisRow To (ThatRow - 1)
If Cells(J, ThisCol) > "" Then
For K = (J + 1) To ThatRow
If Cells(J, ThisCol) = Cells(K, ThisCol) Then
Cells(K, ThisCol) = ""
End If
Next K
End If
Next J
'Remove rows with empty key cells
For J = ThatRow To ThisRow Step -1
If Cells(J, ThisCol) = "" Then
Range(Cells(J, ThisCol), Cells(J, RightCol)).EntireRow.Delete xlShiftUp
End If
Next J
Application.ScreenUpdating = True
End Sub
i tried so much...with for,count etc.. but its running only on the active sheet
kindly provide a solution
thanks
gokz
Bookmarks