Using VBA can we check the FONT format all the files in a Specific Folder

  • Team,


    Basically I am trying a find a code for the below requirement.



    I have a Main file which calls set of files in a certain folder. When I click on Check format button I need to compare all the file mentioned in the Main file.


    When comparing the Main sheet should create a new sheet with all the Failures of Format checking Results.


    I mean which are NON-Arial. The newly created sheet should have 3 columns
    1) File Name
    2) Sheet Name
    3) Cell Name - Cell Value - Arial Font is not matching



    Main File Format of Sheet 1



    https://www.dropbox.com/s/kzoh1brbaf7e55r/Format_Checker_Main%20Sheet.jpg?dl=0


    http://"https://www.dropbox.com/s/kzoh1brbaf7e55r/Format_Checker_Main%20Sheet.jpg?dl=0"


    Sheet 2



    This Sheet need to be created by Macro for Capturing the Failed Non-Arial ones.


    Many Thanks!
    Bindu

  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    hi bindu,


    welcome to the forum... as you should know that the task which you want usses loops and will check each cell in the file on every sheet so be patient while running the macro as its gona take a lot of time depending on your data size.....


  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    Dear Ashu,


    Superb logic. You are genius.


    Four things I need it.


    1) Every time I should have to delete the Font Checker Sheet. Is there any way we have to just clear the contents in Font Checker sheets and then records to be shown when we run the macro.


    2) Path of the Folder we are Hard coding in the Macro. can we Pick the PATH From Cell B3.


    3) Font Should be Picked from Cell C3.


    4) In Column C it is shown as "$A$1-EMP No- Arial Font Is Not Matching", can we shown it without $ like "A1-EMP No- Arial Font Is Not Matching"


    Thanks a lot again!


    Kind Regards,
    Bindu

  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    here's the altered code


  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    Hi Ashu,


    Thanks for helping me!


    I am getting error when I execute this code.


    1) font_cri is not declared
    2) When I hard coded the path it is working fine, where as when we are using like this in the code it is throwing an error.
    font_cri = ActiveSheet.Range("C3").Value


    3) Also I see every time it is created various sheets when I run this macro. I should have only Main sheet and Result sheet we are capturing using Macro.


    Appreciate your help!


    Thanks!
    Bindu

  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    create a sheet named Font Checker as i have removed the code to create a sheet and try this new code



  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    Hi Ashu,


    I have created the Font checker sheet and I got the error at this line.


    ThisWorkbook.Worksheets("Font Checker").ClearContents


    Thanks!
    Bindu

  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    replace this


    Code
    ThisWorkbook.Worksheets("Font Checker").ClearContents


    with this


    Code
    ThisWorkbook.Worksheets("Font Checker").usedrange.ClearContents
  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    hi bindu use this and only keep the excel files into the folder for which you want to get the status


  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    Its working fine but when I ran the macro twice it is throwing me an error and it is not generating any results in "Font Checker"


    Error Line
    If Mid(fname, InStr(fname, "."), 4) <> ".xls" Then GoTo SKP:

  • Re: Using VBA can we check the FONT format all the files in a Specific Folder


    Sorry it my mistake, I should be in Main Sheet and Should run the Macro, I am going to Font Checker Sheet and I am running the Macro.


    Thanks Anshu very much. I really appreciate your help.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!