XLA routines: EE_DeleteColumns
EE_DeleteColumns deletes columns
Sub EE_DeleteColumns(FromCol As Variant, Optional ToCol As Variant) ' - FromCol and ToCol can either be a column, a letter, a number, or a heading 'http://excelexperts.com/xla-routines-eeDeleteColumns for updates on this routine If Not IsMissing(ToCol) Then If ToCol = "" Then ToCol = FromCol End If Else ToCol = FromCol End If If VarType(ToCol) = vbString Then ToCol = CLng(range(ToCol & "1").Column) End If If VarType(FromCol) = vbString Then FromCol = CLng(range(FromCol & "1").Column) End If Dim i As Long For i = FromCol To ToCol Columns(i).Delete Next End Sub
»
- Nick's blog
- Login or register to post comments
- 2925 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago