ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changes in How Code Acts After Upgrade of Excel (https://www.excelbanter.com/excel-programming/449965-changes-how-code-acts-after-upgrade-excel.html)

magmike[_2_]

Changes in How Code Acts After Upgrade of Excel
 
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

Claus Busch

Changes in How Code Acts After Upgrade of Excel
 
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

GS[_2_]

Changes in How Code Acts After Upgrade of Excel
 
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




All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com