+ Reply to Thread
Results 1 to 10 of 10

VBA code for Count if funtion for entire workbook

  1. #1
    Registered User
    Join Date
    03-27-2014
    Location
    Salem, Tamil Nadu, India
    MS-Off Ver
    Excel 2007
    Posts
    36

    Question VBA code for Count if funtion for entire workbook

    Hi all, i just want to count the number of cells contains "general" in E coloumn, in sheets contains SQI in sheetname, in a workbook. please guide me

  2. #2
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: VBA code for Count if funtion for entire workbook

    Hi,

    You can use the below formula to get cells with value "general" in E column in a worksheet.

    Please Login or Register  to view this content.

    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  3. #3
    Registered User
    Join Date
    03-27-2014
    Location
    Salem, Tamil Nadu, India
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA code for Count if funtion for entire workbook

    hi pareshj, i want vba code for the same

  4. #4
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: VBA code for Count if funtion for entire workbook

    Hi,

    Check the below code and hope this is what you want:

    Please Login or Register  to view this content.

    Regards,
    Paresh J

  5. #5
    Registered User
    Join Date
    03-27-2014
    Location
    Salem, Tamil Nadu, India
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA code for Count if funtion for entire workbook

    The Code u entered is for Count the cells in "sheet1" only, i need to count for so many sheets and also the sheet name must contains "SQI". I will be very happy if u can answer this :-)

  6. #6
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: VBA code for Count if funtion for entire workbook

    Hi,

    What exactly is your requirement? Do you want count of word "general" individually on each sheet / as total on one sheet? What is sheet name must contain SQI? Is it that sheet names with SQI should only be checked for counting?


    Regards,
    Paresh J

  7. #7
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: VBA code for Count if funtion for entire workbook

    Hi,

    You can use the below code to get total count of word "general" from all sheets which contains SQI in their sheet names.

    Put the below code in ThisWorkbook.


    Please Login or Register  to view this content.

    Note: If you dont want SQI contains part, you can comment out the IF part in the code.

    Regards,
    Paresh J

  8. #8
    Registered User
    Join Date
    03-27-2014
    Location
    Salem, Tamil Nadu, India
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA code for Count if funtion for entire workbook

    Hi PARESH, i want count of word "general" as total on one sheet, sheet names with SQI should only be checked for counting! I am sorry to made you confused.

  9. #9
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: VBA code for Count if funtion for entire workbook

    Hi,

    Check out the below code, it gives result as expected by you. Please check the cell F1 of each sheet for the count.

    Note: Please paste the below code in the ThisWorkBook section.

    Please Login or Register  to view this content.

    Regards,
    Paresh J

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: VBA code for Count if funtion for entire workbook

    Quote Originally Posted by pareshj View Post
    Hi,

    Check out the below code, it gives result as expected by you. Please check the cell F1 of each sheet for the count.

    Note: Please paste the below code in the ThisWorkBook section.

    .........

    Regards,
    Paresh J
    Hi Paresh,
    Wouldn't the code go into a regular module?
    Is it a workbook_event code?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Code to save copy worksheet not entire workbook
    By njohnn in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-13-2014, 12:00 PM
  2. Code runs on entire workbook...need it to only run on one worksheet
    By jrobertson2403 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-28-2013, 04:50 PM
  3. [SOLVED] This VB code to hide a row is only working for one sheet, and not the entire workbook?
    By ibabs in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 08-07-2013, 04:28 PM
  4. Count entire workbook?
    By neilpateluk in forum Excel General
    Replies: 1
    Last Post: 01-22-2009, 05:48 AM
  5. Changing Code To Modify Entire Workbook
    By sktyrhrtout in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-08-2008, 07:28 PM

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