View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Delete a Column Based on User Entry

Dim yr as Variant, rng as Range
yr = Application.InputBox("Enter a year ex: 2004",type:=1)
if yr = False then exit sub
set rng = Rows(1).find(yr)
if not rng is nothing then
rng.EntireColumn.Delete
end if

--
Regards,
Tom Ogilvy


"Anice" wrote:

I need to have a Macro that prompts the user for a year to delete. The
program would then search the worksheet for that year and delete all data in
that column.

Any suggestions would be great!! Thanks