Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete a Column Based on User Entry
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete a Column Based on User Entry
have a look in vba help for
INPUTBOX FIND -- Don Guillett SalesAid Software "Anice" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete a Column Based on User Entry
Thank you very much. That worked beautifully!
"Tom Ogilvy" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How 2 lock row and column delete/add but allow data entry? | Excel Discussion (Misc queries) | |||
Automating to autofill column B based on column A entry | Excel Discussion (Misc queries) | |||
Auto entry of data based on entry of text in another column or fie | Excel Discussion (Misc queries) | |||
Delete Entry Based on Selection | Excel Discussion (Misc queries) | |||
Filter Excel Pivot, based on user entry form | Excel Discussion (Misc queries) |