1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Macros in MS Excel

Discussion in 'Business Applications' started by Stevrford, Feb 4, 2003.

Thread Status:
Not open for further replies.
  1. Stevrford

    Stevrford Thread Starter

    Feb 4, 2003
    Can anyone help?!? I'm quite fluent with MS Excel and formulas and such, but now I'm venturing into macros, and all I can say is.... huh?!?!?!
    I've used the help file, and it might as well be written in another language for all the help I've gotten out of it! See the attached file to follow along with my description of my problem.
    All I want to do is have a check box (already inserted in cell B4), that when clicked, will turn the cell next to it (C4) yellow to highlight it, and then post a string of text in another cell (A9).
    No doubt this is all painfully simple to those familiar with macros, but I'm completely and totally clueless. According to the help files, I need to understand visual basic programming language, and I don't... it gives examples of how to make a macro to highlight the color of a cell, like I'm trying to do, but again... huh?!?! (see below)
    Static OldRange As Range
    On Error Resume Next
    Target.Interior.ColorIndex = 6 ' yellow - change as needed
    OldRange.Interior.ColorIndex = xlColorIndexNoneSet OldRange = Target
    End Sub

    Is there anyone who can walk me thru the process of highlighting the cell, and posting my text string? Please!



    Attached Files:

    • mef.jpg
      File size:
      75 KB
  2. Anne Troy

    Anne Troy

    Feb 14, 1999
    First Name:
  3. WIP


    Apr 19, 2003
    Like you I have also do not understand the language when it comes to writting macros. So I do what works for me. It my not be written the way that the experts write it, but it works.

    Your problem require 2 steps:

    First the code:

    Public Sub cb_al()
    If Sheets("Sheet2").CheckBoxes("cb_al").value = xlOn Then
    [a9] = "Your Text String Here"
    End If
    If Sheets("Sheet2").CheckBoxes("cb_al").value = xlOff Then
    [a9] = ""
    End If
    End Sub

    Second Conditional Formatting:

    Formula Is: =$a$4>1
    Pattern: Yellow

    I hope this is what your looking for.

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/117013

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice