Time Stamp

Pat_The_Bat

Board Regular
Joined
Jul 12, 2018
Messages
82
Trying to write code that indicates that If a cell on column G is not empty, then the macro should put a timestamp in same row column I.
So basically at the end of my code that is putting data in cells in Column G, it will time stamp the item to show the record of when the data was put into that cell in row G.
The time stamp will go into column I on the same row.

Thank you!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
[ code]
Post your code.

Sub Graphic2_Click()


'This section checks the income templates to see which income docs to load from the Master to the Doc Checklist:


'Salaried Wage Earner
If Range("B4").Value2 = "x" Then Worksheets("Master").Range("B4,B5,B6,B7").Value2 = "x"
'Wage Earner with Bonus
If Range("B5").Value2 = "x" Then Worksheets("Master").Range("B4,B5,B6,B7").Value2 = "x"
'Wage Earner + Commission
If Range("B6").Value2 = "x" Then Worksheets("Master").Range("B4,B5,B6,B7").Value2 = "x"
'Commission Only
If Range("B7").Value2 = "x" Then Worksheets("Master").Range("B4,B5,B6,B7").Value2 = "x"
'Self Employed
If Range("B8").Value2 = "x" Then Worksheets("Master").Range("B4,B5,B6,B7").Value2 = "x"
'Fixed Income-Pension
If Range("B9").Value2 = "x" Then Worksheets("Master").Range("B4,B5,B6,B7").Value2 = "x"
'Fixed Income- IRA
If Range("B10").Value2 = "x" Then Worksheets("Master").Range("B4,B5,B6,B7").Value2 = "x"
'Fixed Income- Social Security
If Range("B11").Value2 = "x" Then Worksheets("Master").Range("B4,B5,B6,B7").Value2 = "x"


'Then add any documents from Master to the Doc Checklist


With Sheets("Master").Range("B2:B100").SpecialCells(xlConstants)
.Offset(, 1).Copy Sheets("Doc Checklist").Range("C2")
End With
On Error Resume Next
Sheets("Doc Checklist").Range("C2:C100").SpecialCells(xlBlanks).EntireRow.Delete
On Error GoTo 0
'Then this section looks for any other documents on the Doc Request sheet and adds them to the the Doc Checklist
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>




Dim LSTROW As Integer
Dim bcol As String 'variable to find row range to analyze column Z for marks
Dim cprange As String 'variable to find those rows which haven't been already copied
Dim zcol As String








'remove rows with empty cells in column C
On Error Resume Next
Sheets("Doc Checklist").Range("C2:C100").SpecialCells(xlBlanks).EntireRow.Delete
On Error GoTo 0




With Sheets("Doc Request")
On Error GoTo err_msg
'based on column C we need to find row range to search for mark in column Z. We will return address for copy
bcol = .Range("B15:B500").SpecialCells(xlConstants).Address

Debug.Print bcol

zcol = .Range(bcol).Offset(, 24).Address

Debug.Print zcol


'based on address from srcchk we determine address range of blank cells
On Error GoTo err_msg
cprange = .Range(zcol).SpecialCells(xlBlanks).Address
Debug.Print cprange

'using address from cprange we move selection left by 25 columns and copy data
.Range(cprange).Offset(, -25).Copy
End With




With Worksheets("Doc Checklist")
LSTROW = .Range("C" & .Rows.Count).End(xlUp).Row + 1

'fill next available cell with a new data
.Range("C" & LSTROW).PasteSpecial xlPasteAll
End With




'once again, using cprange we mark rows which have been copied to "Doc Checklist"
With Sheets("Doc Request")
.Range(cprange).Value = "x"
End With


GoTo SkiptoHere




err_msg:
MsgBox "Income Template Documents may have been added, but no additional docs to have been detected."


SkiptoHere:


'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


'Then this copies the entire list from the Doc Checklist back to the Doc Request so the user has an immediate feedback of the list they are creating


Worksheets("Doc Checklist").Range("C2:C100").Copy Worksheets("Doc Request").Range("I4:I100")


'Then Timestamp

Dim TS As Long





Worksheets("Doc Request").Range("I4").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Range("F3").Select
Selection.NumberFormat = "[$-en-US]m/d/yy h:mm AM/PM;@"



End Sub
[/code ]

Its really just that last bit where I strated to DIM TS as Long ...
 
Upvote 0
Can't see anywhere in your code, where the data's being written to column G.
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,820
Members
449,469
Latest member
Kingwi11y

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top