ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Range of Columns (https://www.excelbanter.com/excel-programming/433887-re-delete-range-columns.html)

Jacob Skaria

Delete Range of Columns
 
Sub Macro()
Dim lngLastcol as Long
lngLastcol = ActiveSheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column
Range("F1", Cells(1, lngLastcol)).EntireColumn.Delete
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"James" wrote:

can you please show me how to delete the entire column starting in column f
until an empty column is encountered. thanks.



All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com