Changes in How Code Acts After Upgrade of Excel

Discussion in 'Excel Programming' started by magmike, Mar 29, 2014.

  1. magmike

    magmike Guest

    I just upraded from Excel 2003 to Excel 2010. Previously, the code below took a template row with formulas and conditional formatting and inserted a copy of it above the currently selected row inside a defined table. However,now, the conditional formatting doesn't carry over.

    If I do this manually, by inserting a row first, then copying the template row (located on another sheet in the workbook) and the paste it over the newly inserted row, then it acts correctly.

    Can someone help me modify the followomg code to mimick doing it manually or tell me what is wrong with mine?

    Sub Nsert_TemplateRow()
    Dim Msg, Style, Title, Response
    Msg = "This will insert a New Row ABOVE your currently selected cell. Do you wish to continue?"
    Style = vbYesNo + vbInformation
    Title = "Insert Row"

    Response = MsgBox(Msg, Style, Title)
    If Response = vbYes Then
    If Selection.Column = 1 Then

    Range("New_Row").Copy
    Selection.Insert Shift:=xlDown
    Application.CutCopyMode = False

    Else
    MsgBox "You must first select a cell in column A", vbInformation, Title
    End If
    Else
    'anything else
    End If

    End Sub

    Thanks in advance for your help,
    magmike
     
    magmike, Mar 29, 2014
    #1
    1. Advertisements

  2. magmike

    Claus Busch Guest

    Hi Mike,

    Am Sat, 29 Mar 2014 13:44:03 -0700 (PDT) schrieb magmike:

    > I just upraded from Excel 2003 to Excel 2010. Previously, the code below took a template row with formulas and conditional formatting and inserted a copy of it above the currently selected row inside a defined table. However, now, the conditional formatting doesn't carry over.


    for me it works fine. Formulas and Conditional Format is also copied.
    Check the range name if it is correctly refered.


    Regards
    Claus B.
    --
    Vista Ultimate SP2 / Windows7 SP1
    Office 2007 Ultimate SP3 / 2010 Professional
     
    Claus Busch, Mar 29, 2014
    #2
    1. Advertisements

  3. magmike

    GS Guest

    Also working as expected for me!

    --
    Garry

    Free usenet access at http://www.eternal-september.org
    Classic VB Users Regroup!
    comp.lang.basic.visual.misc
    microsoft.public.vb.general.discussion
     
    GS, Mar 29, 2014
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.