+ Reply to Thread
Results 1 to 5 of 5

VBA Code to find and apply formatting to specific text strings

  1. #1
    Registered User
    Join Date
    07-16-2008
    Location
    Clarksville, AR
    Posts
    9

    VBA Code to find and apply formatting to specific text strings

    Hi all,

    I am very new to the Macro and VBA "underworld" of Excel, and I have a (hopefully) simple procedural formatting task that I believe can be automated; I'm just not sure how.

    The short way to explain what I need done is to refer you to the attached worksheet and say that I would like to write code to have excel apply formatting to the "raw" worksheet and make it look like the "formatted" worksheet.

    The long way is to provide a detailed explanation of the 3 specific subgoals to this general formatting task:

    1a) Find all cells containing the trial name (e.g., "Trial 2 Interruption nil") and 1b) Highlight all cells on the same row yellow

    2a) Find all cells signaling the beginning of an interruption (e.g., "Interruption TQ begins"),
    2b) Find all cells signaling the end of an interruption (e.g., "Interruption ends"), and
    2c) Highlight all cells on the same rows as 2a and 2b and all cells on rows in between 2a and 2b light yellow

    3a) Find all cells in column F containing the word "incorrect" and
    3b) Highlight those cells red

    The purpose of this reformatting task is to make a range of datasets more amenable to coding and analysis. Any help would be greatly appreciated.
    Attached Files Attached Files
    Last edited by chozen86; 07-21-2008 at 04:17 PM. Reason: Forgot to attach file

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    See how this goes.

    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    07-16-2008
    Location
    Clarksville, AR
    Posts
    9

    works like a charm!

    thanks so much!
    how do you apply this code to an entire workbook?

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Here goes.

    Please Login or Register  to view this content.
    rylo

  5. #5
    Registered User
    Join Date
    07-16-2008
    Location
    Clarksville, AR
    Posts
    9

    yet again, works like a charm

    my first experience with VBA code! hopefully one of many to come.

    many thanks!

+ 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