Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Need some VB help on deleting columns. I have a VB routine that will delete
entire rows, I just need some help getting it turned around to columns. This works good and deletes entire blank rows only. Thanks Bob Sub demo() DeleteBlankDataRows "E", "AI" End Sub Sub DeleteBlankDataRows(FromColumn As String, ThruColumn As String) Dim nFirstRow As Long Dim nLastRow As Long Dim nRow As Long Dim sAddress As String Dim rng As Range With ActiveSheet.UsedRange nLastRow = .Rows.Count + .Row - 1 nFirstRow = .Row End With Application.ScreenUpdating = False For nRow = nLastRow To nFirstRow Step -1 sAddress = FromColumn & nRow & ":" & ThruColumn & nRow Set rng = Range(sAddress) If WorksheetFunction.CountBlank(rng) = rng.Count Then rng.EntireRow.Delete End If Next nRow Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting columns | Setting up and Configuration of Excel | |||
Deleting columns | Excel Discussion (Misc queries) | |||
Adding Columns, Then deleting old columns | Excel Discussion (Misc queries) | |||
Combining Text from 2 Columns into 1 then Deleting the 2 Columns | Excel Worksheet Functions | |||
deleting columns | Excel Discussion (Misc queries) |