+ Reply to Thread
Results 1 to 3 of 3

Function That Returns the Type of Selection

  1. #1
    Registered User
    Join Date
    07-05-2005
    Posts
    11

    Exclamation Function That Returns the Type of Selection

    I'm currently going through a book on VBA programming that gives the following example:
    Please Login or Register  to view this content.
    I'd like to expand the functionality to include a Case where multiple areas are selected and the return string is "Multi" but I cannot for the life of me figure out how to do that. It seems like I should just be able to add an If statement that covers whether or not Selection.Areas.Count > 1 but I'm getting nowhere with that. I get the idea I need to incorporate ParamArray in the function arguments but I don't see why because I don't need to loop through an array to count any values when Selection.Areas.Count already has the correct count. I'm grateful for any help with this!
    Last edited by centerNegative; 08-14-2015 at 01:52 PM. Reason: Solution provided

  2. #2
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Function That Returns the Type of Selection

    This should do it:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-05-2005
    Posts
    11

    Re: Function That Returns the Type of Selection

    That is perfect, cyiangou! Thanks very much for the speedy reply!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help with Type. End Type element selection
    By murraycooper in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-02-2014, 03:13 AM
  2. Lookup function returns Type mismatch??
    By Xceller in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2014, 06:38 PM
  3. Formula returns wrong data type
    By mbrown89 in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 01-30-2010, 12:36 PM
  4. Why VBA returns 3 for xlChart type???
    By Anandi in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-25-2010, 08:25 AM
  5. type of selection if selection is chart
    By Chimanrao in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2005, 11:45 PM
  6. Object Type of a selection... counting rows in a selection
    By Acid-Sky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2005, 05:05 AM
  7. Replies: 2
    Last Post: 06-20-2005, 10:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1