Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro 2003 vs 2007

I have a macro that works on xl2003, but not on xlsm2007.
Is there a twick somewhere?
--
Always Learning
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Macro 2003 vs 2007

What's the specific problem?

Barb Reinhardt

"Lucson" wrote:

I have a macro that works on xl2003, but not on xlsm2007.
Is there a twick somewhere?
--
Always Learning

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Macro 2003 vs 2007

Specifically what is not working on 2007? Post the relevant code and
describe what should happen and what is actually happening.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 23 Oct 2008 08:37:56 -0700, Lucson
wrote:

I have a macro that works on xl2003, but not on xlsm2007.
Is there a twick somewhere?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro 2003 vs 2007

Most of the code should keep working in 2007. We're aware of some object
model that broke, a lot of it is around charting. We're working to fix some
of this in a coming service pack.
If you mail me the broken code, we can try take a look and see what's going
on.

--
Danny Khen
Excel Program Manager, Microsoft Corp.
[To use my email address, replace (dot) and (at) with respective chars, and
(MSFT) with microsoft.com.]

** This posting is provided "AS IS", with no warranties, and confers no
rights. **
"Lucson" wrote in message
...
I have a macro that works on xl2003, but not on xlsm2007.
Is there a twick somewhere?
--
Always Learning


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro 2003 vs 2007

Public FinalRow As Variant
Public RightRow As Long
Public PasteRow As Long
Public Serial1 As String
Public Serial2 As String
Public i As Long
Public j As Integer


Sub Macro1()
'
' Macro1 Macro

' ID last row
FinalRow = Range("A1048576").End(xlUp).Row


' Sort data by "Source_Customer_Code" and freeze column header
Rows("2:2").Select
ActiveWindow.FreezePanes = True
Cells.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

For i = 2 To FinalRow
j = i + 1

Do
RightRow = Range("IV" & i).End(xlToLeft).Column
PasteRow = RightRow + 1

Serial1 = Cells(i, 1).Value 'Give Cust_Cd a value
Serial2 = Cells(j, 1).Value

If Serial1 = Serial2 Then ' test value against row below
Range("H" & j).Copy
Cells(i, PasteRow).PasteSpecial
Rows(j & ":" & j).Select
Selection.Delete
ElseIf Serial2 = "" Then GoTo Done ' this command stops loop

End If

Loop Until Serial1 < Serial2 ' this allow loop to delete multiples of
three or more

Next i

Done:

Cells.Select
With Selection
.VerticalAlignment = xlBottom
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.EntireColumn.AutoFit
Selection.ColumnWidth = 25.57
Columns("A:D").Select
Columns("A:D").EntireColumn.AutoFit
Rows("2:4").Select
Selection.RowHeight = 27
Rows("2:4").EntireRow.AutoFit
Range("E1").FormulaR1C1 = "Mod1"
' Range("E1").AutoFill Destination:=Range("E1:" & PasteRow &
1), Type:=xlFillDefault


MsgBox "Column H is transposed."


End Sub


--
Always Learning


"Danny Khen [MSFT]" wrote:

Most of the code should keep working in 2007. We're aware of some object
model that broke, a lot of it is around charting. We're working to fix some
of this in a coming service pack.
If you mail me the broken code, we can try take a look and see what's going
on.

--
Danny Khen
Excel Program Manager, Microsoft Corp.
[To use my email address, replace (dot) and (at) with respective chars, and
(MSFT) with microsoft.com.]

** This posting is provided "AS IS", with no warranties, and confers no
rights. **
"Lucson" wrote in message
...
I have a macro that works on xl2003, but not on xlsm2007.
Is there a twick somewhere?
--
Always Learning




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro 2003 vs 2007

Please do not waste time on this. It's now working. Ealier on, when launched
the macro, it ran without excuting any code. I am still puzzled. But the good
news is that it works now.
Thanks to all of you.
--
Always Learning


"Lucson" wrote:

Public FinalRow As Variant
Public RightRow As Long
Public PasteRow As Long
Public Serial1 As String
Public Serial2 As String
Public i As Long
Public j As Integer


Sub Macro1()
'
' Macro1 Macro

' ID last row
FinalRow = Range("A1048576").End(xlUp).Row


' Sort data by "Source_Customer_Code" and freeze column header
Rows("2:2").Select
ActiveWindow.FreezePanes = True
Cells.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

For i = 2 To FinalRow
j = i + 1

Do
RightRow = Range("IV" & i).End(xlToLeft).Column
PasteRow = RightRow + 1

Serial1 = Cells(i, 1).Value 'Give Cust_Cd a value
Serial2 = Cells(j, 1).Value

If Serial1 = Serial2 Then ' test value against row below
Range("H" & j).Copy
Cells(i, PasteRow).PasteSpecial
Rows(j & ":" & j).Select
Selection.Delete
ElseIf Serial2 = "" Then GoTo Done ' this command stops loop

End If

Loop Until Serial1 < Serial2 ' this allow loop to delete multiples of
three or more

Next i

Done:

Cells.Select
With Selection
.VerticalAlignment = xlBottom
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.EntireColumn.AutoFit
Selection.ColumnWidth = 25.57
Columns("A:D").Select
Columns("A:D").EntireColumn.AutoFit
Rows("2:4").Select
Selection.RowHeight = 27
Rows("2:4").EntireRow.AutoFit
Range("E1").FormulaR1C1 = "Mod1"
' Range("E1").AutoFill Destination:=Range("E1:" & PasteRow &
1), Type:=xlFillDefault


MsgBox "Column H is transposed."


End Sub


--
Always Learning


"Danny Khen [MSFT]" wrote:

Most of the code should keep working in 2007. We're aware of some object
model that broke, a lot of it is around charting. We're working to fix some
of this in a coming service pack.
If you mail me the broken code, we can try take a look and see what's going
on.

--
Danny Khen
Excel Program Manager, Microsoft Corp.
[To use my email address, replace (dot) and (at) with respective chars, and
(MSFT) with microsoft.com.]

** This posting is provided "AS IS", with no warranties, and confers no
rights. **
"Lucson" wrote in message
...
I have a macro that works on xl2003, but not on xlsm2007.
Is there a twick somewhere?
--
Always Learning


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro 2003 vs 2007

I tried to respond but it seems like it did not go through, so trying again,
and apologies for the delay:

Sorry... I didn't make myself clear. I am asking for a complete Excel file,
with the code, and with instructions of what we need to run in order to see
the problem - I'd like to show it to team testers so that they can figure
out your issue.
Please just email it to me, to Danny dot Khen at microsoft dot com (change
the "dot" and "at" appropriately). Thanks!

--
Danny Khen
Excel Program Manager, Microsoft Corp.
[To use my email address, replace (dot) and (at) with respective chars, and
(MSFT) with microsoft.com.]

** This posting is provided "AS IS", with no warranties, and confers no
rights. **
"Lucson" wrote in message
...
Public FinalRow As Variant
Public RightRow As Long
Public PasteRow As Long
Public Serial1 As String
Public Serial2 As String
Public i As Long
Public j As Integer


Sub Macro1()
'
' Macro1 Macro

' ID last row
FinalRow = Range("A1048576").End(xlUp).Row


' Sort data by "Source_Customer_Code" and freeze column header
Rows("2:2").Select
ActiveWindow.FreezePanes = True
Cells.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

For i = 2 To FinalRow
j = i + 1

Do
RightRow = Range("IV" & i).End(xlToLeft).Column
PasteRow = RightRow + 1

Serial1 = Cells(i, 1).Value 'Give Cust_Cd a value
Serial2 = Cells(j, 1).Value

If Serial1 = Serial2 Then ' test value against row below
Range("H" & j).Copy
Cells(i, PasteRow).PasteSpecial
Rows(j & ":" & j).Select
Selection.Delete
ElseIf Serial2 = "" Then GoTo Done ' this command stops loop

End If

Loop Until Serial1 < Serial2 ' this allow loop to delete multiples of
three or more

Next i

Done:

Cells.Select
With Selection
.VerticalAlignment = xlBottom
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.EntireColumn.AutoFit
Selection.ColumnWidth = 25.57
Columns("A:D").Select
Columns("A:D").EntireColumn.AutoFit
Rows("2:4").Select
Selection.RowHeight = 27
Rows("2:4").EntireRow.AutoFit
Range("E1").FormulaR1C1 = "Mod1"
' Range("E1").AutoFill Destination:=Range("E1:" & PasteRow &
1), Type:=xlFillDefault


MsgBox "Column H is transposed."


End Sub


--
Always Learning


"Danny Khen [MSFT]" wrote:

Most of the code should keep working in 2007. We're aware of some object
model that broke, a lot of it is around charting. We're working to fix
some
of this in a coming service pack.
If you mail me the broken code, we can try take a look and see what's
going
on.

--
Danny Khen
Excel Program Manager, Microsoft Corp.
[To use my email address, replace (dot) and (at) with respective chars,
and
(MSFT) with microsoft.com.]

** This posting is provided "AS IS", with no warranties, and confers no
rights. **
"Lucson" wrote in message
...
I have a macro that works on xl2003, but not on xlsm2007.
Is there a twick somewhere?
--
Always Learning



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro from 2003 to 2007 RogerS Excel Discussion (Misc queries) 0 February 3rd 10 03:54 PM
2003 Macro in a 2007 World hnyb1 Excel Discussion (Misc queries) 1 November 20th 09 05:56 PM
macro between 2003 and 2007 Debbie Horner Excel Discussion (Misc queries) 1 October 15th 08 03:16 PM
Macro 2003 vs 2007 Ron Excel Worksheet Functions 1 September 29th 08 05:40 AM
Macro in 2003 vs 2007 MichaelR Excel Programming 2 July 24th 08 09:24 PM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"