Consulting

Results 1 to 2 of 2

Thread: VBA Macro - Scan worksheet for specific value

  1. #1
    VBAX Regular
    Joined
    Sep 2018
    Location
    Singapore
    Posts
    6
    Location

    VBA Macro - Scan worksheet for specific value

    Looking to create a VBA macro on Excel which scans a worksheet on the document for a specific value(s) and then tally up the results and exports it to a new worksheet.

    So for example; if I had a worksheet consisting of hundreds of colours in a specific column, I'd need the macro to scan that column for all the cells containing the word "blue" and then generate a new worksheet showing "Blue: 15", to represent that blue appeared on the worksheet 15 times. Would also need to scan for other colours too so I'd be looking for multiple values.

    Not too sure how to write out a macro like this using VB so any help would be massively appreciated.

  2. #2
    VBAX Mentor Logit's Avatar
    Joined
    Sep 2016
    Posts
    421
    Location
    .
    <-- Formula for same sheet : =COUNTIF(A1:A15,"Blue")
    <-- Formula for another sheet : =COUNTIF(Sheet1!A1:A15,"Blue")
    See Sheet 2
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

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