Matching file names in Excel column to file names in folder
Hi, I have a column in excel that contains the file names of files that are in a folder (ex: IMG_001, contacs.pdf, essay.docx). I have about 30 rows with miscellaneous file names in the column, and ...
You should place this code on a Standard Module like Module1 and to do so follow these steps...
Open your file and then press Alt+F11 to open VB Editor.
On VB Editor Ribbon -->go to Insert Tab --> and choose Module. This will insert a new Module called Module1 and open a code window.
Paste the code into the opened code window, close the VB Editor.
Save your file as Macro-Enabled Workbook.
On the sheet with data, insert a Shape or a Button from Form Controls, right click to it and choose Assign Macro and then choose the macro SearchFiles from the available macro list and click OK to finish.
Now you may click this shape or button to run the code.
Please find the attached in which I have placed the code on Module1 and inserted a button called "Search Files" on the Sheet. You may click this button to run the code.
No, you cannot undo the steps performed by the macro. Btw what is there which you want to undo after the code execution?
In the attached, I have also tweaked the path of the source folder. Now the code assumes that you have a folder called "Document folder" with all the files on your Desktop.
Hello, everyone. I've been trying to use this macros with no luck. I've already modify path to a folder located in my desktop, names my worksheet after the name, changed colour number but Im only able to creat a folder inside the destination folder. What could possibly is going wrong?
Subodh_Tiwari_sktneer Thank you for your detailed response! I will give that a try and circle back if I run into any errors.
Resources
"}},"componentScriptGroups({\"componentId\":\"custom.widget.MicrosoftFooter\"})":{"__typename":"ComponentScriptGroups","scriptGroups":{"__typename":"ComponentScriptGroupsDefinition","afterInteractive":{"__typename":"PageScriptGroupDefinition","group":"AFTER_INTERACTIVE","scriptIds":[]},"lazyOnLoad":{"__typename":"PageScriptGroupDefinition","group":"LAZY_ON_LOAD","scriptIds":[]}},"componentScripts":[]},"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/community/NavbarDropdownToggle\"]})":[{"__ref":"CachedAsset:text:en_US-components/community/NavbarDropdownToggle-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"shared/client/components/common/QueryHandler\"]})":[{"__ref":"CachedAsset:text:en_US-shared/client/components/common/QueryHandler-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/messages/EscalatedMessageBanner\"]})":[{"__ref":"CachedAsset:text:en_US-components/messages/EscalatedMessageBanner-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/users/UserLink\"]})":[{"__ref":"CachedAsset:text:en_US-components/users/UserLink-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"shared/client/components/users/UserRank\"]})":[{"__ref":"CachedAsset:text:en_US-shared/client/components/users/UserRank-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/messages/MessageTime\"]})":[{"__ref":"CachedAsset:text:en_US-components/messages/MessageTime-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/messages/MessageSolvedBadge\"]})":[{"__ref":"CachedAsset:text:en_US-components/messages/MessageSolvedBadge-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/messages/MessageSubject\"]})":[{"__ref":"CachedAsset:text:en_US-components/messages/MessageSubject-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/messages/MessageBody\"]})":[{"__ref":"CachedAsset:text:en_US-components/messages/MessageBody-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/messages/MessageCustomFields\"]})":[{"__ref":"CachedAsset:text:en_US-components/messages/MessageCustomFields-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/messages/MessageReplyButton\"]})":[{"__ref":"CachedAsset:text:en_US-components/messages/MessageReplyButton-1745505309772"}],"message({\"id\":\"message:1732269\"})":{"__ref":"ForumTopicMessage:message:1732269"},"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"shared/client/components/users/UserAvatar\"]})":[{"__ref":"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"shared/client/components/ranks/UserRankLabel\"]})":[{"__ref":"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/messages/AcceptedSolutionButton\"]})":[{"__ref":"CachedAsset:text:en_US-components/messages/AcceptedSolutionButton-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/messages/LinearReplyList\"]})":[{"__ref":"CachedAsset:text:en_US-components/messages/LinearReplyList-1745505309772"}],"message({\"id\":\"message:1742905\"})":{"__ref":"ForumReplyMessage:message:1742905"},"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/tags/TagView/TagViewChip\"]})":[{"__ref":"CachedAsset:text:en_US-components/tags/TagView/TagViewChip-1745505309772"}],"cachedText({\"lastModified\":\"1745505309772\",\"locale\":\"en-US\",\"namespaces\":[\"components/attachments/AttachmentView/AttachmentViewChip\"]})":[{"__ref":"CachedAsset:text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1745505309772"}],"message({\"id\":\"message:2681634\"})":{"__ref":"ForumReplyMessage:message:2681634"},"message({\"id\":\"message:2382930\"})":{"__ref":"ForumReplyMessage:message:2382930"},"message({\"id\":\"message:1789378\"})":{"__ref":"ForumReplyMessage:message:1789378"}},"CachedAsset:pages-1745487429140":{"__typename":"CachedAsset","id":"pages-1745487429140","value":[{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"BlogViewAllPostsPage","type":"BLOG","urlPath":"/category/:categoryId/blog/:boardId/all-posts/(/:after|/:before)?","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"CasePortalPage","type":"CASE_PORTAL","urlPath":"/caseportal","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"CreateGroupHubPage","type":"GROUP_HUB","urlPath":"/groups/create","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"CaseViewPage","type":"CASE_DETAILS","urlPath":"/case/:caseId/:caseNumber","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"InboxPage","type":"COMMUNITY","urlPath":"/inbox","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"HelpFAQPage","type":"COMMUNITY","urlPath":"/help","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"IdeaMessagePage","type":"IDEA_POST","urlPath":"/idea/:boardId/:messageSubject/:messageId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"IdeaViewAllIdeasPage","type":"IDEA","urlPath":"/category/:categoryId/ideas/:boardId/all-ideas/(/:after|/:before)?","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"LoginPage","type":"USER","urlPath":"/signin","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"BlogPostPage","type":"BLOG","urlPath":"/category/:categoryId/blogs/:boardId/create","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"UserBlogPermissions.Page","type":"COMMUNITY","urlPath":"/c/user-blog-permissions/page","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ThemeEditorPage","type":"COMMUNITY","urlPath":"/designer/themes","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"TkbViewAllArticlesPage","type":"TKB","urlPath":"/category/:categoryId/kb/:boardId/all-articles/(/:after|/:before)?","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1730142000000,"localOverride":null,"page":{"id":"AllEvents","type":"CUSTOM","urlPath":"/Events","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"OccasionEditPage","type":"EVENT","urlPath":"/event/:boardId/:messageSubject/:messageId/edit","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"OAuthAuthorizationAllowPage","type":"USER","urlPath":"/auth/authorize/allow","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"PageEditorPage","type":"COMMUNITY","urlPath":"/designer/pages","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"PostPage","type":"COMMUNITY","urlPath":"/category/:categoryId/:boardId/create","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ForumBoardPage","type":"FORUM","urlPath":"/category/:categoryId/discussions/:boardId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"TkbBoardPage","type":"TKB","urlPath":"/category/:categoryId/kb/:boardId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"EventPostPage","type":"EVENT","urlPath":"/category/:categoryId/events/:boardId/create","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"UserBadgesPage","type":"COMMUNITY","urlPath":"/users/:login/:userId/badges","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"GroupHubMembershipAction","type":"GROUP_HUB","urlPath":"/membership/join/:nodeId/:membershipType","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"MaintenancePage","type":"COMMUNITY","urlPath":"/maintenance","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"IdeaReplyPage","type":"IDEA_REPLY","urlPath":"/idea/:boardId/:messageSubject/:messageId/comments/:replyId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"UserSettingsPage","type":"USER","urlPath":"/mysettings/:userSettingsTab","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"GroupHubsPage","type":"GROUP_HUB","urlPath":"/groups","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ForumPostPage","type":"FORUM","urlPath":"/category/:categoryId/discussions/:boardId/create","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"OccasionRsvpActionPage","type":"OCCASION","urlPath":"/event/:boardId/:messageSubject/:messageId/rsvp/:responseType","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"VerifyUserEmailPage","type":"USER","urlPath":"/verifyemail/:userId/:verifyEmailToken","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"AllOccasionsPage","type":"OCCASION","urlPath":"/category/:categoryId/events/:boardId/all-events/(/:after|/:before)?","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"EventBoardPage","type":"EVENT","urlPath":"/category/:categoryId/events/:boardId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"TkbReplyPage","type":"TKB_REPLY","urlPath":"/kb/:boardId/:messageSubject/:messageId/comments/:replyId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"IdeaBoardPage","type":"IDEA","urlPath":"/category/:categoryId/ideas/:boardId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"CommunityGuideLinesPage","type":"COMMUNITY","urlPath":"/communityguidelines","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"CaseCreatePage","type":"SALESFORCE_CASE_CREATION","urlPath":"/caseportal/create","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"TkbEditPage","type":"TKB","urlPath":"/kb/:boardId/:messageSubject/:messageId/edit","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ForgotPasswordPage","type":"USER","urlPath":"/forgotpassword","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"IdeaEditPage","type":"IDEA","urlPath":"/idea/:boardId/:messageSubject/:messageId/edit","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"TagPage","type":"COMMUNITY","urlPath":"/tag/:tagName","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"BlogBoardPage","type":"BLOG","urlPath":"/category/:categoryId/blog/:boardId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"OccasionMessagePage","type":"OCCASION_TOPIC","urlPath":"/event/:boardId/:messageSubject/:messageId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ManageContentPage","type":"COMMUNITY","urlPath":"/managecontent","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ClosedMembershipNodeNonMembersPage","type":"GROUP_HUB","urlPath":"/closedgroup/:groupHubId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"CommunityPage","type":"COMMUNITY","urlPath":"/","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ForumMessagePage","type":"FORUM_TOPIC","urlPath":"/discussions/:boardId/:messageSubject/:messageId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"IdeaPostPage","type":"IDEA","urlPath":"/category/:categoryId/ideas/:boardId/create","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1730142000000,"localOverride":null,"page":{"id":"CommunityHub.Page","type":"CUSTOM","urlPath":"/Directory","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"BlogMessagePage","type":"BLOG_ARTICLE","urlPath":"/blog/:boardId/:messageSubject/:messageId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"RegistrationPage","type":"USER","urlPath":"/register","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"EditGroupHubPage","type":"GROUP_HUB","urlPath":"/group/:groupHubId/edit","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ForumEditPage","type":"FORUM","urlPath":"/discussions/:boardId/:messageSubject/:messageId/edit","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ResetPasswordPage","type":"USER","urlPath":"/resetpassword/:userId/:resetPasswordToken","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1730142000000,"localOverride":null,"page":{"id":"AllBlogs.Page","type":"CUSTOM","urlPath":"/blogs","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"TkbMessagePage","type":"TKB_ARTICLE","urlPath":"/kb/:boardId/:messageSubject/:messageId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"BlogEditPage","type":"BLOG","urlPath":"/blog/:boardId/:messageSubject/:messageId/edit","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ManageUsersPage","type":"USER","urlPath":"/users/manage/:tab?/:manageUsersTab?","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ForumReplyPage","type":"FORUM_REPLY","urlPath":"/discussions/:boardId/:messageSubject/:messageId/replies/:replyId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"PrivacyPolicyPage","type":"COMMUNITY","urlPath":"/privacypolicy","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"NotificationPage","type":"COMMUNITY","urlPath":"/notifications","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"UserPage","type":"USER","urlPath":"/users/:login/:userId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"OccasionReplyPage","type":"OCCASION_REPLY","urlPath":"/event/:boardId/:messageSubject/:messageId/comments/:replyId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ManageMembersPage","type":"GROUP_HUB","urlPath":"/group/:groupHubId/manage/:tab?","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"SearchResultsPage","type":"COMMUNITY","urlPath":"/search","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"BlogReplyPage","type":"BLOG_REPLY","urlPath":"/blog/:boardId/:messageSubject/:messageId/replies/:replyId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"GroupHubPage","type":"GROUP_HUB","urlPath":"/group/:groupHubId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"TermsOfServicePage","type":"COMMUNITY","urlPath":"/termsofservice","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"CategoryPage","type":"CATEGORY","urlPath":"/category/:categoryId","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"ForumViewAllTopicsPage","type":"FORUM","urlPath":"/category/:categoryId/discussions/:boardId/all-topics/(/:after|/:before)?","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"TkbPostPage","type":"TKB","urlPath":"/category/:categoryId/kbs/:boardId/create","__typename":"PageDescriptor"},"__typename":"PageResource"},{"lastUpdatedTime":1745487429140,"localOverride":null,"page":{"id":"GroupHubPostPage","type":"GROUP_HUB","urlPath":"/group/:groupHubId/:boardId/create","__typename":"PageDescriptor"},"__typename":"PageResource"}],"localOverride":false},"CachedAsset:text:en_US-components/context/AppContext/AppContextProvider-0":{"__typename":"CachedAsset","id":"text:en_US-components/context/AppContext/AppContextProvider-0","value":{"noCommunity":"Cannot find community","noUser":"Cannot find current user","noNode":"Cannot find node with id {nodeId}","noMessage":"Cannot find message with id {messageId}"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/common/Loading/LoadingDot-0":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/common/Loading/LoadingDot-0","value":{"title":"Loading..."},"localOverride":false},"User:user:-1":{"__typename":"User","id":"user:-1","uid":-1,"login":"Deleted","email":"","avatar":null,"rank":null,"kudosWeight":1,"registrationData":{"__typename":"RegistrationData","status":"ANONYMOUS","registrationTime":null,"confirmEmailStatus":false,"registrationAccessLevel":"VIEW","ssoRegistrationFields":[]},"ssoId":null,"profileSettings":{"__typename":"ProfileSettings","dateDisplayStyle":{"__typename":"InheritableStringSettingWithPossibleValues","key":"layout.friendly_dates_enabled","value":"false","localValue":"true","possibleValues":["true","false"]},"dateDisplayFormat":{"__typename":"InheritableStringSetting","key":"layout.format_pattern_date","value":"MMM dd yyyy","localValue":"MM-dd-yyyy"},"language":{"__typename":"InheritableStringSettingWithPossibleValues","key":"profile.language","value":"en-US","localValue":"en","possibleValues":["en-US"]}},"deleted":false},"Theme:customTheme1":{"__typename":"Theme","id":"customTheme1"},"Category:category:microsoft365":{"__typename":"Category","id":"category:microsoft365","entityType":"CATEGORY","displayId":"microsoft365","nodeType":"category","depth":3,"title":"Microsoft 365","shortTitle":"Microsoft 365","parent":{"__ref":"Category:category:products-services"},"categoryPolicies":{"__typename":"CategoryPolicies","canReadNode":{"__typename":"PolicyResult","failureReason":null}}},"Category:category:top":{"__typename":"Category","id":"category:top","displayId":"top","nodeType":"category","depth":0,"title":"Top","entityType":"CATEGORY","shortTitle":"Top"},"Category:category:communities":{"__typename":"Category","id":"category:communities","displayId":"communities","nodeType":"category","depth":1,"parent":{"__ref":"Category:category:top"},"title":"Communities","entityType":"CATEGORY","shortTitle":"Communities"},"Category:category:products-services":{"__typename":"Category","id":"category:products-services","displayId":"products-services","nodeType":"category","depth":2,"parent":{"__ref":"Category:category:communities"},"title":"Products","entityType":"CATEGORY","shortTitle":"Products"},"Forum:board:ExcelGeneral":{"__typename":"Forum","id":"board:ExcelGeneral","entityType":"FORUM","displayId":"ExcelGeneral","nodeType":"board","depth":4,"conversationStyle":"FORUM","title":"Excel","description":"Your community for how-to discussions and sharing best practices on Microsoft Excel. If you’re looking for technical support, please visit Microsoft Support Community.","avatar":null,"profileSettings":{"__typename":"ProfileSettings","language":null},"parent":{"__ref":"Category:category:microsoft365"},"ancestors":{"__typename":"CoreNodeConnection","edges":[{"__typename":"CoreNodeEdge","node":{"__ref":"Community:community:gxcuf89792"}},{"__typename":"CoreNodeEdge","node":{"__ref":"Category:category:communities"}},{"__typename":"CoreNodeEdge","node":{"__ref":"Category:category:products-services"}},{"__typename":"CoreNodeEdge","node":{"__ref":"Category:category:microsoft365"}}]},"userContext":{"__typename":"NodeUserContext","canAddAttachments":false,"canUpdateNode":false,"canPostMessages":false,"isSubscribed":false},"boardPolicies":{"__typename":"BoardPolicies","canPublishArticleOnCreate":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.forums.policy_can_publish_on_create_workflow_action.accessDenied","key":"error.lithium.policies.forums.policy_can_publish_on_create_workflow_action.accessDenied","args":[]}}},"shortTitle":"Excel","repliesProperties":{"__typename":"RepliesProperties","sortOrder":"REVERSE_PUBLISH_TIME","repliesFormat":"threaded"},"tagProperties":{"__typename":"TagNodeProperties","tagsEnabled":{"__typename":"PolicyResult","failureReason":null}},"requireTags":true,"tagType":"PRESET_ONLY","eventPath":"category:microsoft365/category:products-services/category:communities/community:gxcuf89792board:ExcelGeneral/"},"Rank:rank:37":{"__typename":"Rank","id":"rank:37","position":18,"name":"Copper Contributor","color":"333333","icon":null,"rankStyle":"TEXT"},"User:user:754353":{"__typename":"User","id":"user:754353","uid":754353,"login":"Ozz_Kozz","deleted":false,"avatar":{"__typename":"UserAvatar","url":"https://techcommunity.microsoft.com/t5/s/gxcuf89792/m_assets/avatars/default/avatar-2.svg?time=0"},"rank":{"__ref":"Rank:rank:37"},"email":"","messagesCount":11,"biography":null,"topicsCount":4,"kudosReceivedCount":1,"kudosGivenCount":0,"kudosWeight":1,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2020-08-09T22:47:47.898-07:00","confirmEmailStatus":null},"followersCount":null,"solutionsCount":0,"entityType":"USER","eventPath":"community:gxcuf89792/user:754353"},"ForumTopicMessage:message:1732269":{"__typename":"ForumTopicMessage","uid":1732269,"subject":"Matching file names in Excel column to file names in folder","id":"message:1732269","revisionNum":1,"repliesCount":15,"author":{"__ref":"User:user:754353"},"depth":0,"hasGivenKudo":false,"board":{"__ref":"Forum:board:ExcelGeneral"},"conversation":{"__ref":"Conversation:conversation:1732269"},"readOnly":false,"editFrozen":false,"moderationData":{"__ref":"ModerationData:moderation_data:1732269"},"body@stripHtml({\"truncateLength\":200})":" Hi, I have a column in excel that contains the file names of files that are in a folder (ex: IMG_001, contacs.pdf, essay.docx). I have about 30 rows with miscellaneous file names in the column, and ...","body@stringLength":"1054","rawBody":"
Hi, I have a column in excel that contains the file names of files that are in a folder (ex: IMG_001, contacs.pdf, essay.docx). I have about 30 rows with miscellaneous file names in the column, and the folder contains over 1,000 varied files. What I'm looking to accomplish is to use the file names in the Excel column to find the file names in the folder, similar to matching file names between two spreadsheets with VLOOKUP. This will allow me to find the files without having to sift through the entire folder to find specific files or type each file name into the folder search bar.
I tried searching for online for this task but only managed to find how to export file names from a folder to Excel. This task is almost the opposite, being that I already have the file names in Excel and need to find the file names in a folder.
Additionally, I'm not too sure if I'm in the correct conversation community, but since I'm starting with an Excel workbook, I figured I'd start here and hopefully find direction.
Please help!
","kudosSumWeight":0,"postTime":"2020-09-30T14:28:10.873-07:00","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"attachments":{"__typename":"AttachmentConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"tags":{"__typename":"TagConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"TagEdge","cursor":"MjUuMXwyLjF8b3wxMHxfTlZffDE","node":{"__typename":"Tag","id":"tag:developer","text":"developer","time":"2016-07-01T11:00:22.155-07:00","lastActivityTime":null,"messagesCount":null,"followersCount":null}},{"__typename":"TagEdge","cursor":"MjUuMXwyLjF8b3wxMHxfTlZffDI","node":{"__typename":"Tag","id":"tag:excel","text":"excel","time":"2016-06-21T14:08:51.129-07:00","lastActivityTime":null,"messagesCount":null,"followersCount":null}},{"__typename":"TagEdge","cursor":"MjUuMXwyLjF8b3wxMHxfTlZffDM","node":{"__typename":"Tag","id":"tag:Macros and VBA","text":"Macros and VBA","time":"2016-06-24T14:00:56.974-07:00","lastActivityTime":null,"messagesCount":null,"followersCount":null}}]},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:1732269_1"},"latestVersion":null,"metrics":{"__typename":"MessageMetrics","views":58160},"visibilityScope":"PUBLIC","canonicalUrl":null,"seoTitle":null,"seoDescription":null,"isEscalated":null,"placeholder":false,"originalMessageForPlaceholder":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}},"archivalData":null,"customFields":[]},"Conversation:conversation:1732269":{"__typename":"Conversation","id":"conversation:1732269","solved":false,"topic":{"__ref":"ForumTopicMessage:message:1732269"},"lastPostingActivityTime":"2023-08-18T11:15:31.879-07:00","lastPostTime":"2023-08-18T11:15:31.879-07:00","unreadReplyCount":15,"isSubscribed":false},"ModerationData:moderation_data:1732269":{"__typename":"ModerationData","id":"moderation_data:1732269","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"Revision:revision:1732269_1":{"__typename":"Revision","id":"revision:1732269_1","lastEditTime":"2020-09-30T14:28:10.873-07:00"},"ForumReplyMessage:message:1742908":{"__typename":"ForumReplyMessage","id":"message:1742908","conversation":{"__ref":"Conversation:conversation:1732269"},"author":{"__ref":"User:user:394231"},"revisionNum":1,"uid":1742908,"depth":7,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:ExcelGeneral"},"subject":"Re: Matching file names in Excel column to file names in folder","readOnly":false,"editFrozen":false,"moderationData":{"__ref":"ModerationData:moderation_data:1742908"},"parent":{"__ref":"ForumReplyMessage:message:1742905"},"body":"
You should place this code on a Standard Module like Module1 and to do so follow these steps...
Open your file and then press Alt+F11 to open VB Editor.
On VB Editor Ribbon -->go to Insert Tab --> and choose Module. This will insert a new Module called Module1 and open a code window.
Paste the code into the opened code window, close the VB Editor.
Save your file as Macro-Enabled Workbook.
On the sheet with data, insert a Shape or a Button from Form Controls, right click to it and choose Assign Macro and then choose the macro SearchFiles from the available macro list and click OK to finish.
Now you may click this shape or button to run the code.
Please find the attached in which I have placed the code on Module1 and inserted a button called \"Search Files\" on the Sheet. You may click this button to run the code.
No, you cannot undo the steps performed by the macro. Btw what is there which you want to undo after the code execution?
In the attached, I have also tweaked the path of the source folder. Now the code assumes that you have a folder called \"Document folder\" with all the files on your Desktop.
You should place this code on a Standard Module like Module1 and to do so follow these steps...
Open your file and then press Alt+F11 to open VB Editor.
On VB Editor Ribbon -->go to Insert Tab --> and choose Module. This will insert a new Module called Module1 and open a code window.
Paste the code into the opened code window, close the VB Editor.
Save your file as Macro-Enabled Workbook.
On the sheet with data, insert a Shape or a Button from Form Controls, right click to it and choose Assign Macro and then choose the macro SearchFiles from the available macro list and click OK to finish.
Now you may click this shape or button to run the code.
Please find the attached in which I have placed the code on Module1 and inserted a button called \"Search Files\" on the Sheet. You may click this button to run the code.
No, you cannot undo the steps performed by the macro. Btw what is there which you want to undo after the code execution?
In the attached, I have also tweaked the path of the source folder. Now the code assumes that you have a folder called \"Document folder\" with all the files on your Desktop.
All you want to do is, check whether the files listed in column D are found in the Document folder.
e.g. Check if the file tps report.xls listed in cell D2 is found in the Document folder and if it exists in that folder, highlight the cell D2 which would be like a visual indicator that this file was found in the folder and do the same for all the files in column D.
Is that what you are trying to achieve?
","body@stringLength":"739","rawBody":"
Let me know if I understood your requirement.
All you want to do is, check whether the files listed in column D are found in the Document folder.
e.g. Check if the file tps report.xls listed in cell D2 is found in the Document folder and if it exists in that folder, highlight the cell D2 which would be like a visual indicator that this file was found in the folder and do the same for all the files in column D.
Is that what you are trying to achieve?
","author":{"__ref":"User:user:394231"},"isEscalated":null,"postTime":"2020-10-01T21:36:19.013-07:00"},"ForumReplyMessage:message:1740731":{"__typename":"ForumReplyMessage","id":"message:1740731","revisionNum":1,"uid":1740731,"depth":4,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:ExcelGeneral"},"conversation":{"__ref":"Conversation:conversation:1732269"},"subject":"Re: Matching file names in Excel column to file names in folder","readOnly":false,"editFrozen":false,"moderationData":{"__ref":"ModerationData:moderation_data:1740731"},"body":"
Subodh_Tiwari_sktneer Hi, yes but if exist in the Document Folder it should be highlighted in the Document Folder. I'm trying to avoid typing in the file name into the search box of the Document folder and save some time. I would want to find the file and extract it from the large folder. Hope that explains a bit more. Thanks.
","body@stringLength":"586","rawBody":"
Hi, yes but if exist in the Document Folder it should be highlighted in the Document Folder. I'm trying to avoid typing in the file name into the search box of the Document folder and save some time. I would want to find the file and extract it from the large folder. Hope that explains a bit more. Thanks.
","author":{"__ref":"User:user:754353"},"isEscalated":null,"postTime":"2020-10-02T13:38:52.791-07:00","parent":{"__ref":"ForumReplyMessage:message:1737873"}},"ForumReplyMessage:message:1741415":{"__typename":"ForumReplyMessage","id":"message:1741415","revisionNum":1,"uid":1741415,"depth":5,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:ExcelGeneral"},"conversation":{"__ref":"Conversation:conversation:1732269"},"subject":"Re: Matching file names in Excel column to file names in folder","readOnly":false,"editFrozen":false,"moderationData":{"__ref":"ModerationData:moderation_data:1741415"},"body":"
Okay, please try the following code and see if this is something you can work with.
The following code will check the files listed in column 4 of the Table on Sheet called \"B\" in the Document folder and if it finds the file in that folder, it will highlight the cell with filename in the Table and copy the file from Document folder to a Sub-Folder called \"Found Files\".
Sub SearchFiles()\nDim ws As Worksheet\nDim tbl As ListObject\nDim cel As Range\nDim rootFolder As String\nDim strNameNewSubFolder As String\nDim fso As FileSystemObject\nDim newFolder As Folder\nDim fil As File\nDim strFilepath As String\nDim newFilePath As String\n\nSet fso = New FileSystemObject\nSet ws = Worksheets(\"B\")\nSet tbl = ws.ListObjects(1)\n\n'Path of the Source folder with files\nrootFolder = \"C:\\Users\\sktneer\\Documents\"\n\nIf Not fso.FolderExists(rootFolder) Then\n MsgBox rootFolder & \" doesn't exist.\", vbExclamation, \"Source Folder Not Found!\"\n Exit Sub\nEnd If\n\n'files that are found in the Source Folder would be copied to this New Sub-Folder\n'Change the name of the Sub-Folder as per your requirement\nstrNameNewSubFolder = \"Found Files\"\n\nIf Right(rootFolder, 1) <> \"/\" Then rootFolder = rootFolder & \"/\"\n\nIf Not fso.FolderExists(rootFolder & strNameNewSubFolder) Then\n fso.CreateFolder rootFolder & strNameNewSubFolder\nEnd If\n\nSet newFolder = fso.GetFolder(rootFolder & strNameNewSubFolder)\n\ntbl.DataBodyRange.Columns(4).Interior.ColorIndex = xlNone\n\nFor Each cel In tbl.DataBodyRange.Columns(4).Cells\n strFilepath = rootFolder & cel.Value\n newFilePath = newFolder.Path & \"/\" & cel.Value\n If fso.FileExists(strFilepath) Then\n cel.Interior.Color = vbYellow\n Set fil = fso.GetFile(strFilepath)\n 'The following line will copy the file found to the newly created Sub-Folder\n fil.Copy newFilePath\n End If\nNext cel\nSet fso = Nothing\nEnd Sub
","body@stringLength":"2356","rawBody":"
Okay, please try the following code and see if this is something you can work with.
The following code will check the files listed in column 4 of the Table on Sheet called \"B\" in the Document folder and if it finds the file in that folder, it will highlight the cell with filename in the Table and copy the file from Document folder to a Sub-Folder called \"Found Files\".
Sub SearchFiles()\nDim ws As Worksheet\nDim tbl As ListObject\nDim cel As Range\nDim rootFolder As String\nDim strNameNewSubFolder As String\nDim fso As FileSystemObject\nDim newFolder As Folder\nDim fil As File\nDim strFilepath As String\nDim newFilePath As String\n\nSet fso = New FileSystemObject\nSet ws = Worksheets(\"B\")\nSet tbl = ws.ListObjects(1)\n\n'Path of the Source folder with files\nrootFolder = \"C:\\Users\\sktneer\\Documents\"\n\nIf Not fso.FolderExists(rootFolder) Then\n MsgBox rootFolder & \" doesn't exist.\", vbExclamation, \"Source Folder Not Found!\"\n Exit Sub\nEnd If\n\n'files that are found in the Source Folder would be copied to this New Sub-Folder\n'Change the name of the Sub-Folder as per your requirement\nstrNameNewSubFolder = \"Found Files\"\n\nIf Right(rootFolder, 1) <> \"/\" Then rootFolder = rootFolder & \"/\"\n\nIf Not fso.FolderExists(rootFolder & strNameNewSubFolder) Then\n fso.CreateFolder rootFolder & strNameNewSubFolder\nEnd If\n\nSet newFolder = fso.GetFolder(rootFolder & strNameNewSubFolder)\n\ntbl.DataBodyRange.Columns(4).Interior.ColorIndex = xlNone\n\nFor Each cel In tbl.DataBodyRange.Columns(4).Cells\n strFilepath = rootFolder & cel.Value\n newFilePath = newFolder.Path & \"/\" & cel.Value\n If fso.FileExists(strFilepath) Then\n cel.Interior.Color = vbYellow\n Set fil = fso.GetFile(strFilepath)\n 'The following line will copy the file found to the newly created Sub-Folder\n fil.Copy newFilePath\n End If\nNext cel\nSet fso = Nothing\nEnd Sub","author":{"__ref":"User:user:394231"},"isEscalated":null,"postTime":"2020-10-02T22:14:24.781-07:00","parent":{"__ref":"ForumReplyMessage:message:1740731"}},"ForumReplyMessage:message:1742905":{"__typename":"ForumReplyMessage","id":"message:1742905","revisionNum":1,"uid":1742905,"depth":6,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:ExcelGeneral"},"conversation":{"__ref":"Conversation:conversation:1732269"},"subject":"Re: Matching file names in Excel column to file names in folder","readOnly":false,"editFrozen":false,"moderationData":{"__ref":"ModerationData:moderation_data:1742905"},"body":"
Subodh_Tiwari_sktneer Thank you for your reply. Where would I enter this code? And can I undo this after I'm done with the task?
","body@stringLength":"342","rawBody":"
Thank you for your reply. Where would I enter this code? And can I undo this after I'm done with the task?
","author":{"__ref":"User:user:754353"},"isEscalated":null,"postTime":"2020-10-03T21:11:49.031-07:00","parent":{"__ref":"ForumReplyMessage:message:1741415"},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"Attachment:{\"id\":\"attachment:message1742908AttachmentNumber1\",\"url\":\"https://techcommunity.microsoft.com/t5/s/gxcuf89792/attachments/gxcuf89792/ExcelGeneral/76878/1/Search%20Files.xlsm\"}":{"__typename":"Attachment","id":"attachment:message1742908AttachmentNumber1","filename":"Search Files.xlsm","filesize":21834,"contentType":"application/vnd.ms-excel.sheet.macroEnabled.12","url":"https://techcommunity.microsoft.com/t5/s/gxcuf89792/attachments/gxcuf89792/ExcelGeneral/76878/1/Search%20Files.xlsm"},"Revision:revision:1742908_1":{"__typename":"Revision","id":"revision:1742908_1","lastEditTime":"2020-10-03T21:57:06.141-07:00"},"QueryVariables:ReplyList:message:1742908:1":{"__typename":"QueryVariables","id":"ReplyList:message:1742908:1","value":{"id":"message:1742908","sorts":{"postTime":{"direction":"DESC"}},"useAvatar":true,"useAuthorLogin":true,"useAuthorRank":true,"useBody":true,"useKudosCount":true,"useTimeToRead":false,"useMedia":false,"useReadOnlyIcon":false,"useRepliesCount":false,"useSearchSnippet":false,"useAcceptedSolutionButton":true,"useSolvedBadge":false,"useAttachments":false,"attachmentsFirst":5,"useTags":false,"useNodeAncestors":false,"useUserHoverCard":false,"useNodeHoverCard":false,"useModerationStatus":true,"usePreviewSubjectModal":false,"useMessageStatus":true}},"ROOT_MUTATION":{"__typename":"Mutation"},"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1745505309772":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserAvatar-1745505309772","value":{"altText":"{login}'s avatar","altTextGeneric":"User's avatar"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1745505309772":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/ranks/UserRankLabel-1745505309772","value":{"altTitle":"Icon for {rankName} rank"},"localOverride":false},"CachedAsset:text:en_US-components/messages/AcceptedSolutionButton-1745505309772":{"__typename":"CachedAsset","id":"text:en_US-components/messages/AcceptedSolutionButton-1745505309772","value":{"accept":"Mark as Solution","accepted":"Marked as Solution","errorHeader":"Error!","errorAdd":"There was an error marking as solution.","errorRemove":"There was an error unmarking as solution.","solved":"Solved"},"localOverride":false},"CachedAsset:text:en_US-components/messages/LinearReplyList-1745505309772":{"__typename":"CachedAsset","id":"text:en_US-components/messages/LinearReplyList-1745505309772","value":{"title":"{count, plural, one{# Reply} other{# Replies}}","title@board:BLOG":"{count, plural, one{# Comment} other{# Comments}}","title@board:TKB":"{count, plural, one{# Comment} other{# Comments}}","title@board:IDEA":"{count, plural, one{# Comment} other{# Comments}}","title@board:OCCASION":"{count, plural, one{# Comment} other{# Comments}}","noRepliesTitle":"No Replies","noRepliesTitle@board:BLOG":"No Comments","noRepliesTitle@board:TKB":"No Comments","noRepliesTitle@board:IDEA":"No Comments","noRepliesTitle@board:OCCASION":"No Comments","noRepliesDescription":"Be the first to reply","noRepliesDescription@board:BLOG":"Be the first to comment","noRepliesDescription@board:TKB":"Be the first to comment","noRepliesDescription@board:OCCASION":"Be the first to comment","noRepliesDescription@board:IDEA":"Be the first to comment","messageReadOnlyAlert:BLOG":"Comments have been turned off for this post","messageReadOnlyAlert:TKB":"Comments have been turned off for this article","messageReadOnlyAlert:IDEA":"Comments have been turned off for this idea","messageReadOnlyAlert:FORUM":"Replies have been turned off for this discussion","messageReadOnlyAlert:OCCASION":"Comments have been turned off for this event"},"localOverride":false},"User:user:1136814":{"__typename":"User","id":"user:1136814","uid":1136814,"login":"eledder_","biography":null,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2021-08-24T19:57:45.310-07:00"},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://techcommunity.microsoft.com/t5/s/gxcuf89792/m_assets/avatars/default/avatar-11.svg?time=0"},"rank":{"__ref":"Rank:rank:37"},"entityType":"USER","eventPath":"community:gxcuf89792/user:1136814"},"ModerationData:moderation_data:2681634":{"__typename":"ModerationData","id":"moderation_data:2681634","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:2681634":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:1136814"},"id":"message:2681634","revisionNum":1,"uid":2681634,"depth":8,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:ExcelGeneral"},"parent":{"__ref":"ForumReplyMessage:message:1742908"},"conversation":{"__ref":"Conversation:conversation:1732269"},"subject":"Re: Matching file names in Excel column to file names in folder","moderationData":{"__ref":"ModerationData:moderation_data:2681634"},"body":"Hello, everyone. I've been trying to use this macros with no luck. I've already modify path to a folder located in my desktop, names my worksheet after the name, changed colour number but Im only able to creat a folder inside the destination folder. What could possibly is going wrong?","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"203","kudosSumWeight":0,"postTime":"2021-08-24T20:09:54.472-07:00","lastPublishTime":"2021-08-24T20:09:54.472-07:00","metrics":{"__typename":"MessageMetrics","views":47236},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:microsoft365/category:products-services/category:communities/community:gxcuf89792board:ExcelGeneral/message:1732269/message:2681634","repliesCount":0,"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"User:user:287531":{"__typename":"User","id":"user:287531","uid":287531,"login":"TheBorg","biography":null,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2019-02-20T00:59:40.654-08:00"},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://techcommunity.microsoft.com/t5/s/gxcuf89792/m_assets/avatars/default/avatar-10.svg?time=0"},"rank":{"__ref":"Rank:rank:37"},"entityType":"USER","eventPath":"community:gxcuf89792/user:287531"},"ModerationData:moderation_data:2382930":{"__typename":"ModerationData","id":"moderation_data:2382930","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:2382930":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:287531"},"id":"message:2382930","revisionNum":1,"uid":2382930,"depth":8,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:ExcelGeneral"},"parent":{"__ref":"ForumReplyMessage:message:1742908"},"conversation":{"__ref":"Conversation:conversation:1732269"},"subject":"Re: Matching file names in Excel column to file names in folder","moderationData":{"__ref":"ModerationData:moderation_data:2382930"},"body":"
Subodh_Tiwari_sktneer How can i modify the code from your example file that can i search just a part of the filename not the exact filename?
If in the search folder i have the file named 111;222;333.pdf if i search 222 the result should be exactly like i search the entire filename.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"208","kudosSumWeight":0,"postTime":"2021-05-25T01:53:30.108-07:00","lastPublishTime":"2021-05-25T01:53:30.108-07:00","metrics":{"__typename":"MessageMetrics","views":50354},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:microsoft365/category:products-services/category:communities/community:gxcuf89792board:ExcelGeneral/message:1732269/message:2382930","repliesCount":0,"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:1789378":{"__typename":"ModerationData","id":"moderation_data:1789378","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:1789378":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:754353"},"id":"message:1789378","revisionNum":1,"uid":1789378,"depth":8,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:ExcelGeneral"},"parent":{"__ref":"ForumReplyMessage:message:1742908"},"conversation":{"__ref":"Conversation:conversation:1732269"},"subject":"Re: Matching file names in Excel column to file names in folder","moderationData":{"__ref":"ModerationData:moderation_data:1789378"},"body":"
Subodh_Tiwari_sktneer Thank you for your detailed response! I will give that a try and circle back if I run into any errors.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"137","kudosSumWeight":0,"postTime":"2020-10-16T11:21:51.600-07:00","lastPublishTime":"2020-10-16T11:21:51.600-07:00","metrics":{"__typename":"MessageMetrics","views":56319},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:microsoft365/category:products-services/category:communities/community:gxcuf89792board:ExcelGeneral/message:1732269/message:1789378","repliesCount":0,"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"CachedAsset:text:en_US-components/tags/TagView/TagViewChip-1745505309772":{"__typename":"CachedAsset","id":"text:en_US-components/tags/TagView/TagViewChip-1745505309772","value":{"tagLabelName":"Tag name {tagName}"},"localOverride":false},"CachedAsset:text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1745505309772":{"__typename":"CachedAsset","id":"text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1745505309772","value":{"errorTitle":"Failed!","previewFile":"Preview File","downloadFile":"Download File {name}","removeFile":"Remove File {name}","errorBadExtension":"This file does not have a valid extension. \"{extensions}\" are the valid extensions.","errorFileEmpty":"This file is empty or does not exist.","errorTooLarge":"The maximum file size is: {maxFileSize}.","errorTooMany":"Too many attachments. The maximum number of attachments per message is: {maxAttachmentCount, number, integer}.","errorDuplicate":"This file is already attached."},"localOverride":false}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"excelgeneral","messageSubject":"matching-file-names-in-excel-column-to-file-names-in-folder","messageId":"1732269","replyId":"1742908"},"buildId":"HEhyUrv5OXNBIbfCLaOrw","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","openTelemetryClientEnabled":false,"openTelemetryConfigName":"o365","openTelemetryServiceVersion":"25.1.0","openTelemetryUniverse":"prod","openTelemetryCollector":"http://localhost:4318","openTelemetryRouteChangeAllowedTime":"5000","apolloDevToolsEnabled":false,"inboxMuteWipFeatureEnabled":false},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["./components/seo/QAPageSchema/QAPageSchema.tsx","./components/community/Navbar/NavbarWidget.tsx","./components/community/Breadcrumb/BreadcrumbWidget.tsx","./components/customComponent/CustomComponent/CustomComponent.tsx","./components/messages/TopicWithThreadedReplyListWidget/TopicWithThreadedReplyListWidget.tsx","./components/external/components/ExternalComponent.tsx","./components/messages/MessageView/MessageViewStandard/MessageViewStandard.tsx","../shared/client/components/common/List/UnwrappedList/UnwrappedList.tsx","./components/tags/TagView/TagView.tsx","./components/tags/TagView/TagViewChip/TagViewChip.tsx","./components/attachments/AttachmentView/AttachmentView.tsx","./components/attachments/AttachmentView/AttachmentViewChip/AttachmentViewChip.tsx","../shared/client/components/common/List/UnstyledList/UnstyledList.tsx","./components/messages/MessageView/MessageView.tsx"],"appGip":true,"scriptLoader":[{"id":"analytics","src":"https://techcommunity.microsoft.com/t5/s/gxcuf89792/pagescripts/1730819800000/analytics.js?page.id=ForumReplyPage&entity.id=board%3Aexcelgeneral&entity.id=message%3A1742908","strategy":"afterInteractive"}]}