| |

Fortgeschrittene Programmierungvariablenbezeichnung | |  | Autor: Silversnake@Hawkmoon | Datum: 27.02.02 14:47 |
| Sub Makro1()
'
' Makro1 Makro
' Makro am 15.02.2002 von Praktikant aufgezeichnet
'
'
v = 2
w = 2
x = 2
y = 2
z = 2
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;D:....", Destination:=Range("A1"))
.Name = "...."
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(1, 9, 17, 13, 11, 11, 15, 11, 14, 9, 13)
.Refresh BackgroundQuery:=False
End With
Columns("A:A").Select
Selection.ClearContents
Columns("B:B").Select
Selection.Cut Destination:=Columns("A:A")
Columns("C:C").Select
Selection.Cut Destination:=Columns("B:B")
Columns("L:L").Select
Selection.Cut Destination:=Columns("C:C")
Columns("K:K").Select
Selection.Cut Destination:=Columns("O:O")
Columns("J:J").Select
Selection.Cut Destination:=Columns("N:N")
Columns("I:I").Select
Selection.Cut Destination:=Columns("L:L")
Columns("H:H").Select
Selection.Cut Destination:=Columns("J:J")
Columns("G:G").Select
Selection.Cut Destination:=Columns("H:H")
Columns("H:H").Select
Range("G2").Select
ActiveCell.FormulaR1C1 = "=(RC[-1]/10000)"
Range("I2").Select
ActiveCell.FormulaR1C1 = "=(RC[-1]/10000)"
Range("K2").Select
ActiveCell.FormulaR1C1 = "=(RC[-1]/100)"
Range("M2").Select
ActiveCell.FormulaR1C1 = "=(RC[-1]/100)"
Range("P2").Select
ActiveCell.FormulaR1C1 = "=(RC[-1]*-1)"
Range("A1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Konto."
Range("B1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Rech-Nr."
Range("C1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Beleg-Nr."
Range("D1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Rech-Dat."
Range("E1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Art-Nr."
Range("F1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Menge(gw)"
Range("G1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Menge"
Range("H1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Preis(gw)"
Range("I1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Preis(€)"
Range("J1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Rabatt(gw)"
Range("K1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Rabatt"
Range("L1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Wert(gw)"
Range("M1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Wert(€)"
Range("N1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "VTR"
Range("O1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Marge(gw)"
Range("P1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Marge in %"
Range("M2").Select
Columns("N:N").ColumnWidth = 8.86
Columns("M:M").ColumnWidth = 10.14
Columns("E:E").ColumnWidth = 12.29
Columns("D ").ColumnWidth = 11
Columns("C:C").ColumnWidth = 10.71
Columns("B:B").ColumnWidth = 12.86
Columns("F:F").Select
Selection.EntireColumn.Hidden = True
Columns("H:H").Select
Selection.EntireColumn.Hidden = True
Columns("J:J").Select
Selection.EntireColumn.Hidden = True
Columns("L:L").Select
Selection.EntireColumn.Hidden = True
Columns("O:O").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.ScrollColumn = 1
Rows("1:1").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
152
v = v + 1
If Range("f", [v]) > 0 Then
Range("G", [v]).Select
ActiveCell.FormulaR1C1 = "=(RC[-1]/10000)"
GoTo 152
Else
End If
160
w = w + 1
If Range("h", [w]) > 0 Then
Range("i", [w]).Select
ActiveCell.FormulaR1C1 = "=(RC[-1]/10000)"
GoTo 160
Else
End If
168
x = x + 1
If Range("j", [x]) > 0 Then
Range("k", [x]).Select
ActiveCell.FormulaR1C1 = "=(RC[-1]/100)"
GoTo 168
Else
End If
176
y = y + 1
If Range("l", [y]) > 0 Then
Range("m", [y]).Select
ActiveCell.FormulaR1C1 = "=(RC[-1]/100)"
GoTo 176
Else
End If
184
z = z + 1
If Range("o", [z]) > 0 Then
Range("p", [z]).Select
ActiveCell.FormulaR1C1 = "=(RC[-1]*-1)"
GoTo 184
Else
End If
End Sub
Fehlermeldung: das objekt range für die methode global ist fehlgeschlagen.
frage: wie muss die variable v,w,x,y,z ausschauen? |  |
 | Sie sind nicht angemeldet! Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.
Einloggen | Neu registrieren |
  |
|
sevGraph (VB/VBA) 
Grafische Auswertungen
Präsentieren Sie Ihre Daten mit wenig Aufwand in grafischer Form. sevGraph unterstützt hierbei Balken-, Linien- und Stapel-Diagramme (Stacked Bars), sowie 2D- und 3D-Tortendiagramme und arbeitet vollständig datenbankunabhängig! Weitere InfosTipp des Monats Oktober 2025 Matthias KozlowskiUmlaute konvertierenErsetzt die Umlaute in einer Zeichenkette durch die entsprechenden Doppelbuchstaben (aus ä wird ae, usw.) Access-Tools Vol.1 
Über 400 MByte Inhalt
Mehr als 250 Access-Beispiele, 25 Add-Ins und ActiveX-Komponenten, 16 VB-Projekt inkl. Source, mehr als 320 Tipps & Tricks für Access und VB
Nur 24,95 EURWeitere Infos
|