![]() |
MACRO every 2nd Coulm want delete in selection
hello,
I want creat a macro which i want use delete my selection every second coulm. A_col B_col C_col 1 2 <----- want delete 3 4 <------want delete 5 Thanks/Tufail |
MACRO every 2nd Coulm want delete in selection
Hi Tufail,
Try: '================ Public Sub Tester() Dim rng As Range Dim delRng As Range Dim i As Long Dim CalcMode As Long Set rng = Selection '<<==== CHANGE On Error GoTo XIT With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With For i = 2 To rng.Rows.Count Step 2 If delRng Is Nothing Then Set delRng = rng.Rows(i) Else Set delRng = Union(rng.Rows(i), delRng) End If Next i If Not delRng Is Nothing Then delRng.EntireRow.Delete End If XIT: With Application .Calculation = CalcMode .ScreenUpdating = True End With End Sub '<<================ --- Regards, Norman "Tufail" wrote in message ... hello, I want creat a macro which i want use delete my selection every second coulm. A_col B_col C_col 1 2 <----- want delete 3 4 <------want delete 5 Thanks/Tufail |
All times are GMT +1. The time now is 02:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com