Sub aktion(c As Range)
' ActiveCell.FormulaR1C1 = "*"
' Range("B9:F9").Select
Range(Cells(c.row, 2), Cells(c.row, 7)).Select
Selection.Merge
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.Font.Italic = True
' B bis G rahmen (Rahmenlinie außen)
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
End Sub
Sub SternzeilenFormat()
Dim c As Range
With Worksheets(1).Range("A:A")
Set c = .Find(what:="~*", LookIn:=xlValues, SearchOrder:=xlByColumns)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Call aktion(c)
Set c = .FindNext(c)
Loop While (Not c Is Nothing) And (c.Address <> firstAddress)
End If
End With
End Sub
Sub aktion2(c As Range)
' ActiveCell.FormulaR1C1 = "-"
' Range("B9:F9").Select
Range(Cells(c.row, 2), Cells(c.row, 7)).Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
Selection.Font.Italic = False
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub
Sub SternzeilenUnFormat()
Dim c As Range
With Worksheets(1).Range("A:A")
Set c = .Find("#", LookIn:=xlFormulas, SearchOrder:=xlByColumns)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Call aktion2(c)
Set c = .FindNext(c)
Loop While (Not c Is Nothing) And (c.Address <> firstAddress)
End If
End With
End Sub
Zellen kopieren // *CLOSED* //
sebal 22.11.2007 - 52 Hits - 1 Antwort
Zellen verbinden ???
JeremyMcNeill 24.01.2008 - 35 Hits - 2 Antworten
VBA + zellen vergleichen und rausschreiben
seebaer_1 26.02.2008 - 132 Hits - 9 Antworten
VBA-Problem
seebaer_1 25.02.2008 - 54 Hits - 5 Antworten