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

  • Home
  • SEARCH
  • 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 4558942
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:43:09+00:00 2026-05-21T17:43:09+00:00

I have several revision numbers I need to create folders from. So, lets say

  • 0

I have several revision numbers I need to create folders from. So, lets say {4, 12, 534}. From this, I need to create folders that can be sorted accordingly;

\004\..
\012\..
\534\..

So, what I need to is to get the highest number and then see, how many filling zeros I need for every foldername so they are sorted correct after creating them.

How can I do this using VBA (Excel)? I tried converting them to strings and then dealing around with String operations, but this didn’t quite work out.

I hope someone has a nice idea for this…

  • 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-05-21T17:43:09+00:00Added an answer on May 21, 2026 at 5:43 pm

    Easiest to precompute the max then loop again and pad;

    Dim nums() As String: nums = Split("4,12,534,9999", ",")
    Dim i As Long
    Dim max As Long
    
    For i = 0 To UBound(nums)
        If (Len(nums(i)) > max) Then max = Len(nums(i))
    Next
    
    For i = 0 To UBound(nums)
        nums(i) = String(max - Len(nums(i)), "0") & nums(i)
        Debug.Print nums(i)
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have working copies of several different folders from my SVN repository
I have several textboxes where users can enter information into them. This can include
I have a file that contains several lines of: revision=abcdabcdabcd0000111122223333 revision=0000111122223333444455556666 And I want
I have several repositories that have been converted from SVN and moving forward we
I have a tag with several changes on it whose base revision came from
I know the standard Major.Minor.Build.Revision but there's several considerations for us that are somewhat
I have a couple tables that I want to keep a revision history on.
I have a script, that I need to run after committing to a project
I have a Clojure main application that depends on several Clojure libraries, two of
I have a project with several dependencies that are in various repositories. Each time

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.