• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

** Solved ** How to check if the user has not selected same file

Status
Not open for further replies.

ThrottleWorks

Excel Ninja
Hi,

I was trying to post below mentioned problem on the Forum.

But while writing the problem in details I realized how it can be solved.
This has happened multiple times with me. :p

Moderator, please remove this post if you feel.

I am using below mentioned code for giving user an option to select file(s).

User is required to select approx. 6 files. For example file A for current week and File A for previous week.

I have provided a userform to user where he selects multiple file.
My problem is, user is supposed to select files for current week and previous week on macro prompt.

What if, he selects same file on different prompts. How do we check that if user has selected same file.


Code:
Application.EnableEvents = False
        Workbooks.Open shMacro.Range("a1").Value
    Application.EnableEvents = True

Code I am using as a check.

Code:
'Check if the user has selected same Control Sheet
    If File1.Name = File3.Name Then
        MsgBox "It seems you can't even select files !"
        End
    End If
 
Status
Not open for further replies.
Back
Top