+ Reply to Thread
Results 1 to 4 of 4

Need Sample VBA Code

  1. #1
    Bill Sturdevant
    Guest

    Need Sample VBA Code

    I have a cell (A3) with conditional formatting.

    Via VBA code, I want to be able to say "Make the conditional formatting for
    cells A6 through A500 the same as the conditional formatting for cell A3".

  2. #2
    Tom Ogilvy
    Guest

    Re: Need Sample VBA Code

    Sub ABCD()
    Range("A3").Copy
    Range("A6:A500").PasteSpecial xlPasteFormats

    End Sub

    Copies all the formatting from Cell A3 including the Conditional formatting.

    --
    Regards,
    Tom Ogilvy


    "Bill Sturdevant" <[email protected]> wrote in
    message news:[email protected]...
    > I have a cell (A3) with conditional formatting.
    >
    > Via VBA code, I want to be able to say "Make the conditional formatting

    for
    > cells A6 through A500 the same as the conditional formatting for cell A3".




  3. #3
    ben
    Guest

    RE: Need Sample VBA Code

    apply the following code to every cell you need to

    Range("a3").Copy
    Range("A6").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False

    or if the conditional formatting will always be the same

    lookup formatcondition, in the help index to program the format conditions
    directly
    (xl2003)




    "Bill Sturdevant" wrote:

    > I have a cell (A3) with conditional formatting.
    >
    > Via VBA code, I want to be able to say "Make the conditional formatting for
    > cells A6 through A500 the same as the conditional formatting for cell A3".


  4. #4
    Lars-&Aring;ke Aspelin
    Guest

    Re: Need Sample VBA Code

    On Wed, 26 Jan 2005 11:23:07 -0800, Bill Sturdevant
    <[email protected]> wrote:

    >I have a cell (A3) with conditional formatting.
    >
    >Via VBA code, I want to be able to say "Make the conditional formatting for
    >cells A6 through A500 the same as the conditional formatting for cell A3".


    Try this

    Range("A3").Select
    Selection.Copy
    Range("A6:A500").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False

    Hope this works as expected.

    Lars-Åke

+ 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