Q:

Select the last row and then format it in excel with VB

I am trying to create a user form that inserts data into the last row of a spreadsheet in a logical fashion, but the data is not formatted once I drop it in to the cells. My first thought would be to simply select the last row and format it before I drop the data in. The '.Rows.Autofit' property works with this code, but the other settings, such as text that is left aligned, which is what I really need, do not work. What am I missing? (I replaced all userform text things and variables with "Stuff" for NDA reasons. I know this creates duplicates)
Private Sub StuffUpload_Click()

Dim ws As Worksheet

'   Grabs the worksheet that the user is currently looking at, making this 
'   form work on all sheets
Set ws = ActiveSheet

'   Make sure all required fields have been entered
 If Stuff.Text = "" Then
     MsgBox "You must enter Stuff."
     Stuff.SetFocus
     Exit Sub
End If

' Add a dash of formatting to the last row so the stuff we put into it will 
' look nice
ws.Range("B" & Rows.Count).End(xlUp).Offset(1).Select
With Selection
    .HorizontalAlignment = xlLeft
    .VerticalAlignment = xlBottom
    .WrapText = True
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    .Rows.AutoFit
End With

'   Adds the Stuff info into Col B at the Last Blank Row
ws.Range("B" & Rows.Count).End(xlUp).Offset(1).Value = Me.Stuff.Value
'   Add date and time stamp for the moment the comment was entered
ws.Range("C" & Rows.Count).End(xlUp).Offset(1).Value = Date + Time
'   Adds the Stuff info into Col D at the last Blank Row
ws.Range("D" & Rows.Count).End(xlUp).Offset(1).Value = Me.Stuff.Value

Unload Me

End Sub

A:

Try replacing your code with the code below:
Private Sub StuffUpload_Click()

Dim ws As Worksheet
Dim LastRow As Long
Dim RngAnchor As Range

' Grabs the worksheet that the user is currently looking at,
' making this form work on all sheets    
Set ws = ActiveSheet

'   Make sure all required fields have been entered
If Stuff.Text = "" Then
     MsgBox "You must enter Stuff."
     Stuff.SetFocus
     Exit Sub
End If

' Add a dash of formatting to the last row so the stuff we put into it will
' look nice
With ws
    LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row ' get the last row in column "B"

    ' set the anchor point of the range in column "B"
    Set RngAnchor = .Range("B" & LastRow + 1)

    ' Adds the Stuff info into Col B at the Last Blank Row
    RngAnchor.Value = Me.Stuff.Value

    ' Add date and time stamp for the moment the comment was entered
    RngAnchor.Offset(, 1).Value = Now

    ' Adds the Stuff info into Col D at the last Blank Row
    RngAnchor.Offset(, 2).Value = Me.Stuff.Value  '<-- already added this on Column "B"

    ' now format last row, cells "B:D"
    With RngAnchor.Resize(1, 3)
        .HorizontalAlignment = xlLeft
        .VerticalAlignment = xlBottom
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
        .Rows.AutoFit
    End With

End With

Unload Me

End Sub

