Hello, I have a unique situation where I need to delete the columns between two columns. The number of columns between these two will be different at various times... Column_B will always be the second column, but as columns are added in between, "Column_C" will push to the right
Here is my initial attempt... but it results in a run-time error 13 type mismatch. It highlights the bold/underlined line of code below.
Any thoughts? Thank you in advance for any guidance you may be able to provide.
Here is my initial attempt... but it results in a run-time error 13 type mismatch. It highlights the bold/underlined line of code below.
Any thoughts? Thank you in advance for any guidance you may be able to provide.
Code:
Sub Res_Hrs_Cost()
Dim Column_B As Integer
Dim Column_C As Integer
With Application
.DisplayAlerts = False
.ScreenUpdating = False
.EnableEvents = False
End With
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '(1.) DELETE COLUMNS BETWEEN START & END
Set Dest_Sh = Sheets("SHEET 1")
[I][U][B]Column_B = Dest_Sh.UsedRange.Find("Column B", , xlValues, xlWhole)[/B][/U][/I]
Column_C = Dest_Sh.UsedRange.Find("Column C", , xlValues, xlWhole)
If Column_C > 3 Then
Dest_Sh.Range(Cells(1, Column_B + 1), Cells(1, Column C - 1)).EntireColumn.Delete
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ExitTheSub:
Application.GoTo Dest_Sh.Cells(1)
ActiveWindow.DisplayGridlines = False
With Application
.DisplayAlerts = True
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub