Consulting

Results 1 to 4 of 4

Thread: Solved: How many ".bmp" formatted files in the folder?

  1. #1
    VBAX Tutor Erdin? E. Ka's Avatar
    Joined
    Sep 2006
    Location
    Bursa
    Posts
    264
    Location

    Solved: How many ".bmp" formatted files in the folder?

    Hi everyone,

    I need a sample code about "how to counting ".bmp" formatted files in a folder?"

    For example;

    ......
    Dim FileFormat as string
    Dim FolderName as string
    Dim Result as integer
    FileFormat = ".bmp"
    FolderName: "C:\Pictures\"

    Example of result that i want:
    MsgBox "Total of the " & FileFormat & formatted files in the " & FolderName & "is " & Result" & "."
    ......

    I tried While ... Wend loop but, i couldn't deal with it.

    Can i get the result to a variable? And what should be my code?

    Thans a lot.
    Erdin? E. Kara?am | Loves from Bursa city in Republic of T?rkiye

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Have a look at "FileSearch Object" in the VBA Help files.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  4. #4
    VBAX Tutor Erdin? E. Ka's Avatar
    Joined
    Sep 2006
    Location
    Bursa
    Posts
    264
    Location
    Quote Originally Posted by mdmackillop
    Have a look at "FileSearch Object" in the VBA Help files.
    &


    Hi mdmackillop and Ken Puls, it's ok...

    Thank you very much.
    Erdin? E. Kara?am | Loves from Bursa city in Republic of T?rkiye

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •