+ Reply to Thread
Results 1 to 3 of 3

simple copy paste macro required

  1. #1
    Registered User
    Join Date
    02-25-2007
    Location
    scotland
    Posts
    4

    simple copy paste macro required

    i am trying to write a macro to enable me to copy and paste conditional formatting.

    i want to copy the conditional formatting i have in a block K2 through to Q8 then paste to K10 through to Q16 , i am using numers in K1-Q1 as the critera for the conditional formatting, this is what i have so far

    Range("K2:Q8").Select
    Selection.Copy
    Range("K10:Q16").Select
    Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    Application.CutCopyMode = False
    End Sub

    the conditional format is as below
    condition 1, formula is =countif($K$1:$p$1,K2)
    condition 2, formula is =countif($Q$1,K2)

    when i run the macro it obviously gives me the coditional formatting using the
    K1, P1 criteria i want it to use the criteria from the K9,P9 line.
    at the moment i then have to go into the conditional formatting and change the conditions to the K9 set.
    i will have to do thia about 1000 times is there a better way

  2. #2
    Forum Contributor
    Join Date
    02-28-2006
    Posts
    690
    The macro below copies the conditional formatting in cell F11 to Cell K11, it works fine, I just tried it.


    Range("F11").Select
    Selection.Copy
    Range("K11").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    Application.CutCopyMode = False

    Bob
    End Sub

  3. #3
    Forum Contributor
    Join Date
    02-28-2006
    Posts
    690
    I think you need to look at the formulas in the conditional formatting boxes.

+ 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