LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Undefined MergeArea when MergeCells is true

I'm getting an error message in the workbook_sheetchange event when I execute
the first copy command below after Deleting the contents of a merged range.
When Updating the contents of the same cell this command works. The
MergeArea seems to be undefined. I thought the MergeArea had to be defined
if MergeCells=true. What am I missing?

If Target.MergeCells Then
Target.MergeArea.Copy
Destination:=CopySheetWorksheet.Range(CopySheetWor ksheet.Cells(Target.MergeArea.Row,
Target.MergeArea.Column), CopySheetWorksheet.Cells(Target.MergeArea.Row +
Target.MergeArea.Rows.count, Target.MergeArea.Column +
Target.MergeArea.Columns.count))
Else
Target.Copy
Destination:=CopySheetWorksheet.Range(CopySheetWor ksheet.Cells(Target.Row,
Target.Column), CopySheetWorksheet.Cells(Target.Row + Target.Rows.count,
Target.Column + Target.Columns.count))
End If

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Functions Undefined James O. Thompson Excel Worksheet Functions 2 January 20th 09 10:41 PM
determine if sheet contains mergearea(s) dk Excel Programming 4 October 6th 06 09:53 PM
Undefined function q Excel Programming 4 February 25th 06 03:47 AM
Undefined function q Excel Programming 3 February 24th 06 09:22 PM


All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"