vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
vb@rchiv Offline-Reader - exklusiv auf der vb@rchiv CD Vol.4  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Fortgeschrittene Programmierung
variablenbezeichnung 
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?
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
variablenbezeichnung72Silversnake@Haw...27.02.02 14:47
Re: variablenbezeichnung40Tolwyn27.02.02 15:52
Danke für deine Hilfe43Silversnake@Haw...28.02.02 09:03

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

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel