Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Contents
Why does the following not work on merged cells?
Range("DailyHours").ClearContents When this does Application.Goto Reference:="DailyHours" Selection.ClearContents I must be able to clear the contents of a range without selecting it, how? Thanks for the help Richard |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Contents
Hi,
Try this, range("DailyHours").MergeArea.clearcontents Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Richard" wrote in message ... Why does the following not work on merged cells? Range("DailyHours").ClearContents When this does Application.Goto Reference:="DailyHours" Selection.ClearContents I must be able to clear the contents of a range without selecting it, how? Thanks for the help Richard |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Contents
I assume DailyHours refers to a single cell within a merged area - so try:
Range("DailyHours").MergeArea.ClearContents which worked for me -- Regards, Tom Ogilvy "Richard" wrote: Why does the following not work on merged cells? Range("DailyHours").ClearContents When this does Application.Goto Reference:="DailyHours" Selection.ClearContents I must be able to clear the contents of a range without selecting it, how? Thanks for the help Richard |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Contents
Tom
DailyHours refers to a range of cells, within which there are merged cells. Richard "Tom Ogilvy" wrote: I assume DailyHours refers to a single cell within a merged area - so try: Range("DailyHours").MergeArea.ClearContents which worked for me -- Regards, Tom Ogilvy "Richard" wrote: Why does the following not work on merged cells? Range("DailyHours").ClearContents When this does Application.Goto Reference:="DailyHours" Selection.ClearContents I must be able to clear the contents of a range without selecting it, how? Thanks for the help Richard |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Contents
Andy
thanks for the idea, doesn't seems to work Cheers Richard "Andy Pope" wrote: Hi, Try this, range("DailyHours").MergeArea.clearcontents Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Richard" wrote in message ... Why does the following not work on merged cells? Range("DailyHours").ClearContents When this does Application.Goto Reference:="DailyHours" Selection.ClearContents I must be able to clear the contents of a range without selecting it, how? Thanks for the help Richard |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear Contents
In what way does it not work?
Maybe you can provide detail of the range, DailyHours. What cells does it include? Which of the cells in the range are merged. Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Richard" wrote in message ... Andy thanks for the idea, doesn't seems to work Cheers Richard "Andy Pope" wrote: Hi, Try this, range("DailyHours").MergeArea.clearcontents Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Richard" wrote in message ... Why does the following not work on merged cells? Range("DailyHours").ClearContents When this does Application.Goto Reference:="DailyHours" Selection.ClearContents I must be able to clear the contents of a range without selecting it, how? Thanks for the help Richard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
clear contents | Excel Programming | |||
Macro to clear range contents when cell contents are changed by us | Excel Programming | |||
Clear contents | Excel Programming | |||
Clear contents | Excel Programming | |||
Clear contents if x is not in the row | Excel Programming |