Your technology certification is waiting. Enroll in Cloud Class ®
Dim lastCell As Range
Set lastCell = Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious, searchorder:=xlByColumns)
If Not lastCell Is Nothing Then Range(Cells(1, lastCell.Column + 1), Cells(Rows.Count, Columns.Count)).Delete
Open in new window
Dim Ws As Worksheet
Dim LastC As Long
Dim DelRng As Range
Set Ws = Worksheets("Sheet1") ' Change your sheet name here
LastC = Ws.Cells(1, Columns.Count).End(xlToLeft).Column
Set DelRng = Ws.Range(Ws.Cells(1, LastC + 1), Ws.Cells(1, Columns.Count))
Application.ScreenUpdating = False
Application.ScreenUpdating = True
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.