G
Guest
I'm using excel for my planning and using macro's to make it more easy to
plan. I can already automaticly insert tekst I put into the macro, but I also
want to automatic insert starting times and ending times in those macro's.
These times are in a timeline in the top of my sheet (Row 4) and the
selection of those times vary, because nobody works the same hours every day.
These times should come in the tekst as mentioned in the last line of the
macro.
So it should state: "Starting time - Ending time herman" so "07:00 - 14:15
herman"
The macro I'm using is copied under this tekst.
I hope somebody can help me!!
Thanks in advance
Paul.
Sub herman()
'
' herman Macro
' Macro recorded 7/17/02 by c8226929
'
' Keyboard Shortcut: Ctrl+m
'
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = True
End With
With Selection.Interior
.ColorIndex = 53
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
ActiveCell.FormulaR1C1 = " - herman"
End Sub
plan. I can already automaticly insert tekst I put into the macro, but I also
want to automatic insert starting times and ending times in those macro's.
These times are in a timeline in the top of my sheet (Row 4) and the
selection of those times vary, because nobody works the same hours every day.
These times should come in the tekst as mentioned in the last line of the
macro.
So it should state: "Starting time - Ending time herman" so "07:00 - 14:15
herman"
The macro I'm using is copied under this tekst.
I hope somebody can help me!!
Thanks in advance
Paul.
Sub herman()
'
' herman Macro
' Macro recorded 7/17/02 by c8226929
'
' Keyboard Shortcut: Ctrl+m
'
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = True
End With
With Selection.Interior
.ColorIndex = 53
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
ActiveCell.FormulaR1C1 = " - herman"
End Sub