Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all entries in selection except activecell
How can I delete all entries from a selection except for the currently active
cell? In other words, if I have selected the range (A3:a12), I would like to retain the value of A3 but delete the contents of all other cells. Thanks for your help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all entries in selection except activecell
Best bet is something like:
dim active_val as string active_val = activecell.value with selection ..clearcontents end with activecell.value = active_val "Elaine" wrote: How can I delete all entries from a selection except for the currently active cell? In other words, if I have selected the range (A3:a12), I would like to retain the value of A3 but delete the contents of all other cells. Thanks for your help. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all entries in selection except activecell
Thank you very much for your help.
"Naomi" wrote: Best bet is something like: dim active_val as string active_val = activecell.value with selection .clearcontents end with activecell.value = active_val "Elaine" wrote: How can I delete all entries from a selection except for the currently active cell? In other words, if I have selected the range (A3:a12), I would like to retain the value of A3 but delete the contents of all other cells. Thanks for your help. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete all entries in selection except activecell
Safer/more robust would be to user the formula property which will preserve
either formula or value dim active_val as string active_val = activecell.Formula with selection ..clearcontents end with activecell.Formula = active_val -- Regards, Tom Ogilvy "Elaine" wrote in message ... Thank you very much for your help. "Naomi" wrote: Best bet is something like: dim active_val as string active_val = activecell.value with selection .clearcontents end with activecell.value = active_val "Elaine" wrote: How can I delete all entries from a selection except for the currently active cell? In other words, if I have selected the range (A3:a12), I would like to retain the value of A3 but delete the contents of all other cells. Thanks for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
Delete first character in ActiveCell | Excel Programming | |||
Delete rows from activecell | Excel Programming | |||
Use of Selection.Find & ActiveCell | Excel Programming | |||
Delete the row where the activecell is located with VBA | Excel Programming |