+ Reply to Thread
Results 1 to 3 of 3

Number of Files in Double-Click Event

  1. #1
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,001

    Number of Files in Double-Click Event

    .
    The following works great for counting number of .JPG files in a folder :

    Please Login or Register  to view this content.

    I need to implement it or something similar within a Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) event.

    If the number of .JPG files exceeds 20, then the user needs to be informed and then exit until the folder contains 20 or fewer .JPG files.

    I've attempted to call the above macro first - outside of the Worksheet_BeforeDoubleClick but of course when the macro exits ... it simply continues on
    with the remainder of the code in the Worksheet_BeforeDoubleClick.

    I've tried placing some of the code within the Worksheet_BeforeDoubleClick .... BUT, it constantly exits if there are 5 files, 20 files or 21 files. It makes no difference.

    Anyone have a resource or a suggestion ?

    Thank you for your time.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Number of Files in Double-Click Event

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,001

    Re: Number of Files in Double-Click Event

    .
    AlphaFrog:

    Thank you so much for the assist.

    Works great !


    Stay healthy !

+ 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. [SOLVED] Before double click event with if statements (Double clicking blank cell stops bdc firing)
    By camdenpars in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-27-2014, 09:03 AM
  2. Click v double click event code
    By Greg J in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2014, 04:08 AM
  3. Double Click Event Help
    By mannymg in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2014, 02:56 PM
  4. Double Click Event
    By CARONTE in forum Excel General
    Replies: 6
    Last Post: 06-16-2009, 12:41 AM
  5. Double click event
    By CARONTE in forum Excel General
    Replies: 1
    Last Post: 06-14-2009, 03:02 AM
  6. double click event
    By DTrain9481 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-10-2009, 12:41 PM
  7. userform label double-click goes to click event
    By John Paul Fullerton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2006, 01:00 PM

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