Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7888867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:56:50+00:00 2026-06-03T05:56:50+00:00

Hope you are well. I’m trying to create a mass folder creator using Excel

  • 0

Hope you are well.

I’m trying to create a mass folder creator using Excel and vba. It’s my first time using VBA as I usually focus on web-based languages so forgive me for my lack of knowledge in advance. I have some code already it’s just putting the finishing touches that I’m struggling with.

Currently, the user specifies a directory in a given cell and name of the parent file in another cell. Upon clicking a button, the macro creates the parent folder using the directory and name from the parent file cell. It then creates sub folders using the values of any cells the respondent has selected upon running the macro.

I am currently struggling with the next stage of the project which is creating sub-folders (I’ll just call them Grandchildren) within the subfolders. This would be easy if all of the subfolders had the same Grandchildren however, this is not the case. What I would like to do is grab the 3 values to the right of each cell which defines the name of the subfolder and use them to create the Grandchildren however I’m currently getting the ‘Invalid Qualifier’ message with the code I am currently using (see below).

BasePath = Range("folder_path")

'Check if the project folder already exists and if so raise and error and exit
If Dir(BasePath, vbDirectory) <> "" Then
MsgBox BasePath & " already exists", , "Error"
Else

'Create the project folder
MkDir BasePath

MsgBox "Parent folder creation complete"

'Loop through the 1st tier subfolders and create them
For Each c In ActiveWindow.RangeSelection.Cells
    'create new folder path
    NewFolder = BasePath & "\" & c.Value
    'create folder

    If fs.folderexists(NewFolder) Then
        'do nothing
    Else
        MkDir NewFolder
    End If

Next c

'Create GrandChildren
For Each d In ActiveWindow.RangeSelection.Cells
    'Offset the selection to the right

    For Each e In d.Offset(0, 1).Resize(1, 3).Cells

    Test = e.Value
    GrandChild = BasePath & "\" & d.Value & "\" & Test

    If fs.folderexists(GrandChild) Then
        'do nothing
    Else
        MkDir GrandChild
    End If

Next e
Next d

MsgBox "Sub-folder creation complete"

End If

End Sub

If you require any further information please let me know.

Cheers,

Jason

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:56:52+00:00Added an answer on June 3, 2026 at 5:56 am

    I think your problem is here

    Test = d.Offset(0, 1).Select

    Test is a String and you are selecting a cell. You should try this:

    Test = d.Offset(0,1).Value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey people hope all is well.. i am trying to create a form in
Well, first of all, I hope I stated my problem correctly. I am using
hope all is well. I am using Version 7.0. This morning I was struggling
I hope you are well today, I am trying to calculate the swipe distance
this is my first question here so I hope I can articulate it well
I hope I can explain this problem decently well! I'm trying to implement a
I hope I can explain this well enough so that you can understand the
Well, I have a simple question, at least I hope its simple. I was
Hope this isn't a waste of your time. I'm working on a project, and
I am trying to create multiple dependent dropdowns (selects) with a unique way. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.