Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Select case bugging out

Any idea on why I keep getting Application-defined or object-defined
error when it gets to this line of code?

Select Case Selection.MergeArea.Cells.Count

Thanks in advance for the help.
Jay
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Select case bugging out

Depends on what your selection is. The merge area property only works if the
range (in this case Selection) is a single cell. For example try this...
Create a Merger area of cells A1:B2
Now run this code...

MsgBox Range("A1").MergeArea.Cells.Count

and you will get 4.

This code will not work

MsgBox Range("A1:B1").MergeArea.Cells.Count

as the merge area for A1 and B1 may or may not be the same (it is in this
case but it does not have to be)...

Now to the big question... What exactly are you trying to do???
--
HTH...

Jim Thomlinson


"jlclyde" wrote:

Any idea on why I keep getting Application-defined or object-defined
error when it gets to this line of code?

Select Case Selection.MergeArea.Cells.Count

Thanks in advance for the help.
Jay

Reply
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
Select Case jlclyde Excel Discussion (Misc queries) 5 January 6th 09 09:05 PM
Select case Hein Excel Discussion (Misc queries) 2 October 22nd 08 07:06 AM
Case Select NoodNutt Excel Worksheet Functions 7 September 21st 08 02:10 AM
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
Select Case Jeff Excel Discussion (Misc queries) 1 February 27th 06 02:56 PM


All times are GMT +1. The time now is 02:33 PM.

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

About Us

"It's about Microsoft Excel"