Live-Forum - Die aktuellen Beiträge
Datum
Titel
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
336to340
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
336to340
336to340
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

VBA - Namen automatisch eintragen

VBA - Namen automatisch eintragen
18.11.2003 13:50:14
Simon
Morgen,

also ich öffne eine excel datei in welcher nur meine Makros gespeichert sind.
nun zieh ich eine .DBF Datei in mein excel. So eine Datei enhält nur eine reihe von vielen Zahlen.
Praktisch eine große Tabelle (Messwerte). Dann führ ich mein Makro aus. Und diese
Tabelle die mein Makro mir dann mit den Daten der .DBF zeichnet soll den Namen dieser .DBF-Datei haben (an der stelle Name = "7513113")Die Zeile mit dem Kommentar '31.10.03 fällt dann weg. Irgendwas klappt einfach nicht, hab aber keine ahnung was.


Sub Dia_75_zeichnen()
Dim Zeilen As String
Dim Name As String
Zeilen = Range("A65536").End(xlUp).Row
Name = "7513113"
Range("A:A,E:E,F:F,L:L").Select
Windows(Name + ".DBF").Activate
Range("L1").Activate
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Sheets(Name).Range( _
"A1:A" + Zeilen + ",E1:F" + Zeilen + ",L1:L" + Zeilen), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = Mid(Name, 3, 2) + "." + Mid(Name, 5, 2) + "." + Mid(Name, 7, 2) '"31.10.03"
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.HasLegend = True
Selection.Position = xlBottom
ActiveChart.PlotArea.Select
ActiveChart.Legend.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
Selection.Interior.ColorIndex = xlNone
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 74
.MaximumScale = 76
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.ColorIndex = 3
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 3
.Shadow = False
End With
ActiveChart.SeriesCollection(3).Select
With Selection.Border
.ColorIndex = 4
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 3
.Shadow = False
End With
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.ColorIndex = 5
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 3
.Shadow = False
End With
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
.CrossesAt = 1
.TickLabelSpacing = 50
.TickMarkSpacing = 1
.AxisBetweenCategories = True
.ReversePlotOrder = False
End With
End Sub


Gruß und vielen Dank

Simon

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: VBA - Namen automatisch eintragen
18.11.2003 17:54:31
Nepumuk
Hallo Simon,
bis auf das, dass da natürlich 31.11.3 rauskommt klappt das bei mir. Die Jahreszahl zweistellig geht so: Format(Mid(Name, 7), "00")
Gruß
Nepumuk
Anzeige

300 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige