+ 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
    5,121

    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
    8,778

    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
    5,121

    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)

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