Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
144to148
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
144to148
144to148
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Excelmakros

Excelmakros
02.08.2002 20:44:11
Jochen
hallo,
ich bekomme immer diese fehlermeldung:
the item with the specified name wasn't found
kann jemand damit was anfangen?

folgende stelle wird mir im VBA code angezeigt:
ActiveSheet.Shapes("Chart9").IncrementLeft -175.2

folgendes hab ich gemacht: ich habe ein makro entworfen, welches ein diagramm ausgeben soll und dieses diagramm habe ich nach meinen wuenschen umgestaltet.

anbei der gesamte code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8/2/2002 by jwerner
'
' Keyboard Shortcut: Ctrl+j
'
Dim UserRange As Range
Dim UserSheet As Worksheet
Set UserRange = Selection
Set UserSheet = ActiveSheet
Range("J28:J54,M28:M54").Select
Range("M28").Activate
ActiveWindow.SmallScroll Down:=13
Charts.Add
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SetSourceData Source:=UserRange, _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).Name = "=""272/287/111_107,1.75/1.70,18/18"""
ActiveChart.Location Where:=xlLocationAsObject, Name:=UserSheet.Name
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Chart Title"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = _
"Engine Speed (r/min)"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Cor Torque (ft-lbs)"
End With
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Interior
.ColorIndex = 2
.PatternColorIndex = 1
.Pattern = xlSolid
End With
ActiveChart.ChartArea.Select
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
.MinimumScale = 6400
.MaximumScale = 7800
.MinorUnitIsAuto = True
.MajorUnit = 200
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 495
.MaximumScale = 525
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Windows("super1.xls").SmallScroll Down:=28
Windows("super1.xls").ScrollRow = 38
ActiveChart.ChartArea.Select
ActiveSheet.Shapes("Chart9").IncrementLeft -175.2
ActiveSheet.Shapes("Chart 9").IncrementTop 269.4
Windows("super1.xls").SmallScroll Down:=13
ActiveSheet.Shapes("Chart 9").ScaleHeight 1.59, msoFalse, msoScaleFromTopLeft
ActiveSheet.Shapes("Chart 9").ScaleWidth 1.18, msoFalse, _
msoScaleFromBottomRight
Windows("super1.xls").SmallScroll Down:=6
ActiveSheet.Shapes("Chart 9").ScaleWidth 0.98, msoFalse, msoScaleFromTopLeft
ActiveChart.ChartTitle.Select
Selection.Left = 279
Selection.Top = 1
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.Size = 24
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.PlotArea.Select
Selection.Top = 28
Selection.Width = 590
Selection.Height = 482
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.AutoScaleFont = True
With Selection.TickLabels.Font
.Name = "Arial"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlCategory).Select
Selection.TickLabels.AutoScaleFont = True
With Selection.TickLabels.Font
.Name = "Arial"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlValue).AxisTitle.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlCategory).AxisTitle.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 57
.Weight = xlMedium
.LineStyle = xlContinuous
End With
Selection.Interior.ColorIndex = xlNone
ActiveChart.Legend.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
Selection.Left = 208
Selection.Top = 373
Selection.Width = 354
Selection.Height = 74
With Selection.Border
.ColorIndex = 57
.Weight = xlMedium
.LineStyle = xlContinuous
End With
Selection.Shadow = False
Selection.Interior.ColorIndex = xlAutomatic
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.ColorIndex = 57
.Weight = xlThick
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlAutomatic
.MarkerForegroundColorIndex = xlAutomatic
.MarkerStyle = xlAutomatic
.Smooth = False
.MarkerSize = 9
.Shadow = False
End With
End Sub

7
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Re: Excelmakros
02.08.2002 21:10:53
Herbert H.
Shapes("Chart9") ist offensichtlich nicht vorhanden,darum
die Fehlermeldung.
Versuche vielleicht mit dem Makrorecorder den richtigen Namen herauszufinden.
Gruß Herbert
Re: Excelmakros
02.08.2002 22:04:58
mattis
Einmal Shapes("Chart9") und
einmal Shapes("Chart 9")
kann nicht gut gehen...

gruß
mattis

Re: Excelmakros
02.08.2002 22:32:06
mattis
Eine gute Idee ist immer im Thread zu bleiben.

Ich würde ja schon fasst meine Hand ins Feuer
legen, dass er, wenn Du "Chart9" in "Chart 9"
umbenennst, nicht mehr an derselben Stelle stehen bleibt.

Wie heißt Dein Shape jetzt eigentlich? "Chart9" oder
"Chart 9"? Auch wenn Du sehr viele With hast, die
sind soweit ich das gesehen habe alle geschlossen.

gruß mattis

Anzeige
Re: Excelmakros
02.08.2002 22:43:28
jochen
mein shape heisst Chart 9.
ich weiss echt nicht mehr weiter.
er bleibt naemlich immer noch an der gleichen stelle stehen.

gruss
jochen

Re: Excelmakros
02.08.2002 22:45:37
jochen
mein shape heisst Chart 9.
er bleibt immer noch an der gleichen stelle stehen.
ich hab echt keine ahnung warum

gruss
jochen

Re: Excelmakros
02.08.2002 22:52:17
mattis
Und Dein Chart 9 ist wirklich im
Workbook("super1.xls").

Ich meine was mir sowieso schleierhaft ist,
dass der Makrorekorder einmal Chart 9 und einmal
Chart9 aufgezeichnet hat.

Es muß wirklich was mit den Namen zu tun
haben, da Du genau in besagter Zeile das
erst mal auf das Shape("Chart 9") zugreifst.

gruß mattis

Anzeige
sorry jochen... ...Frage offen!!!
02.08.2002 23:12:23
mattis
... ich muß ins Wochenende ...

Tut mir leid, dass ich Dir nicht direkt helfen konnte.
Schau morgen mal in den Thread. Da werden bestimmt
ein paar gepostet haben. (Soll heissen, das ein 1 Tag
alter Thread noch taufrisch ist, und man deswegen keinen
neuen aufmachen muß ... ; )

wünsche Dir ein schönes WE
mattis

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige