PDA

View Full Version : Solved: Include Date In Code



BENSON
11-13-2008, 10:58 PM
I saw the following code in this forum which I can use.However is it possible to have the date that the code is run appear above the collum which is being pasted. In this case the date should appear in row six just above the transfer data.

Thanks

Sub TransferData()
Dim NextCol As Long

With ActiveSheet

NextCol = .Cells(7, .Columns.Count).End(xlToLeft).Column + 1
If NextCol = 3 Then NextCol = 5

.Range("N7:N195").Copy
.Cells(7, NextCol).PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End With

End Sub

GTO
11-14-2008, 04:34 AM
Would this work?

Sub TransferData()
Dim NextCol As Long

With ActiveSheet

'...statements...

'// plase today's date, formatted like "11/14/2008"
.Cells(6, NextCol).Value = Format(Date, "mm/dd/yyyy")
End With

End Sub

Hope this helps,

Mark

BENSON
11-14-2008, 05:10 AM
PERFECT THANKYOU