Macro formatting
Posted by RoB on August 14, 2001 3:09 PM
Yet another question! I have the following code which fills the cell to the right if data is entered. I would like the row that is being filled to be formatted as "mmmm" (month only). (the cell being filled from is formatted as mm/dd/yy). I thought this would work, then just format the filled row as "mmmm", but it seems the macro overrides the column format. when it fills, it copies exactly as the first column.
how do i specify formatting in a macro? here is my macro:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 Then
If Target.Columns.Count < 2 Then
If Target <> "" Then
With Target
.Offset(0, 1).FillRight
End With
End If
End If
End If
End Sub
Thanks!