Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Missing code in macro
I recorded a macro but when I go into the editor a lot of the code is
missing. All I see are objects that are activated or selected (see below). I am using Excel 2007 on WindowsXP. Does anyone know what is going on? I never had this problem with Excel 2003. Thanks in advance, Lee Sub Macro2() ActiveSheet.ChartObjects("Chart 1").Activate ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.Legend.Select ActiveSheet.ChartObjects("Chart 1").Activate ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartTitle.Select ActiveSheet.ChartObjects("Chart 1").Activate ActiveSheet.ChartObjects("Chart 1").Activate End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Missing code in macro
You probably already know that there are some things that the recorder will
not record. It basically records cell/range selections and keystrokes. "Lee" wrote: I recorded a macro but when I go into the editor a lot of the code is missing. All I see are objects that are activated or selected (see below). I am using Excel 2007 on WindowsXP. Does anyone know what is going on? I never had this problem with Excel 2003. Thanks in advance, Lee Sub Macro2() ActiveSheet.ChartObjects("Chart 1").Activate ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.Legend.Select ActiveSheet.ChartObjects("Chart 1").Activate ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartTitle.Select ActiveSheet.ChartObjects("Chart 1").Activate ActiveSheet.ChartObjects("Chart 1").Activate End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Missing code in macro
I just recorded this with 2003 to test.
Sub Macro6() ' ' Macro6 Macro ' Macro recorded 12/16/2008 by Donald B. Guillett ' ' ActiveSheet.ChartObjects("Chart 2").Activate ActiveChart.ChartArea.Select With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = "mytitlehere" End With ActiveChart.HasLegend = True ActiveChart.Legend.Select Selection.Position = xlLeft ActiveWindow.Visible = False Windows("20081201.xls").Activate Range("U26").Select End Sub I then went to 2007 and recorded this. As you can see, I also had problems but it seems to work. I haven't worked much with charts in 2007. I'm sure it can be cleaned up without selections. Sub Macro7() '2007 recordes ActiveSheet.ChartObjects("Chart 2").Activate ActiveChart.ChartTitle.Select ActiveChart.ChartTitle.Text = "xxxNewtitlehere" ActiveSheet.ChartObjects("Chart 2").Activate ActiveChart.Legend.Select ActiveSheet.ChartObjects("Chart 2").Activate ActiveChart.Legend.LegendEntries(1).Select ActiveSheet.ChartObjects("Chart 2").Activate Range("S18").Select ActiveSheet.ChartObjects("Chart 2").Activate ActiveChart.Legend.Select ActiveSheet.ChartObjects("Chart 2").Activate Selection.Top = 95.1 Selection.Height = 33.354 ActiveSheet.ChartObjects("Chart 2").Activate Selection.Left = 15.058 Selection.Top = 92.1 Range("V15").Select End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Lee" wrote in message ... I recorded a macro but when I go into the editor a lot of the code is missing. All I see are objects that are activated or selected (see below). I am using Excel 2007 on WindowsXP. Does anyone know what is going on? I never had this problem with Excel 2003. Thanks in advance, Lee Sub Macro2() ActiveSheet.ChartObjects("Chart 1").Activate ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.Legend.Select ActiveSheet.ChartObjects("Chart 1").Activate ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartTitle.Select ActiveSheet.ChartObjects("Chart 1").Activate ActiveSheet.ChartObjects("Chart 1").Activate End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro - Code Missing | Excel Discussion (Misc queries) | |||
What is missing from this form code? | Excel Programming | |||
Missing code | Excel Programming | |||
Missing something in my code... | Excel Programming | |||
VB code gone missing | Excel Programming |