+ Reply to Thread
Results 1 to 6 of 6

how do i extract numbers from alphanumeric file name?

  1. #1
    Registered User
    Join Date
    01-28-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    how do i extract numbers from alphanumeric file name?

    I'm developing (playing around!) with VBA, just getting the hang of it. How would I extract the number from my testfile_007.docm so that I can rename it as testfile_008, thus not inadvertantly wiping out anything important while i stumble around?

    Thx in advance - Steve
    Last edited by LonesomeTwin; 02-08-2011 at 06:04 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: how do i extract numbers from alphanumeric file name?

    If the naming convention is that consistent

    Please Login or Register  to view this content.
    would give you the number - where strFName is a variable which holds "testfile_007.docm"

  3. #3
    Registered User
    Join Date
    01-28-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: how do i extract numbers from alphanumeric file name?

    Reputation++

  4. #4
    Registered User
    Join Date
    01-28-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: how do i extract numbers from alphanumeric file name?

    Sorry about this but I'm a C programmer and this is all a bit... odd. I'd like to include the leading zero's for proper directory display. Yes I know explorer does it any way but humour me?

    Please Login or Register  to view this content.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: how do i extract numbers from alphanumeric file name?

    Perhaps you mean:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-28-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: how do i extract numbers from alphanumeric file name?

    Exactly so. From this shaky begiining I'm supposed to put out a report generated auotmatically from a machine. Wish me luck.

    Back to solved we go then. See you again I should think.

+ 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