View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Deleting Columns with VBA

On Oct 18, 2:24*pm, "kittronald" wrote:
Don,

* * Thanks for the quick response.

* * The problem I'm running into is populating the range in
Columns("...").Delete, which can vary in its value.

* * The range could be "B:B", "B:E", etc.

- Ronald K.


Sub delcolbandcifSAS()
lc = Application.Match(2, Rows(1), 1)
fc = Application.Match(2, Rows(1), 0)
If lc - fc 1 Then Columns(fc).Resize(, lc - fc).Delete
End Sub