JC_Riptide
New Member
- Joined
- Mar 14, 2017
- Messages
- 2
Hello,
I've recorded a few macros before and have done some light coding, but nothing too intense. I'm running into a problem where I'm trying to populate a blank cell in a row provided the user fills in values to the left of this field.
User will manually populate columns 1-11 on spreadsheet, and column 12 needs to populate a timestamp that is in a static position on the spreadsheet (cell F1). I'd like for the user to be able to populate multiple rows of their data (i.e. A3300 - K3300, A3301 - K3301), and the macro to timestamp the same static value to column 12 in multiple rows (up to the last row the user has populated data). The timestamp should be applied in the scenario that Column A has data and Column L is blank.
Here's the code I currently have - I'm not receiving any errors, but I think there's some circular reference in here that I'm not comprehending. I set i = 3 as the first two rows are locked with the button and timestamp field (=NOW() in Excel). Can you please assist?
Sub Timestamp()
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
TotesRow = Cells(Rows.Count, 12).End(xlUp).Row
For i = 3 To FinalRow
If Cells(i, 12).Value = "" Then
Cells(TotesRow + 1, 12).Value = Range("F1")
End If
Next i
End Sub
Thanks,
JC
I've recorded a few macros before and have done some light coding, but nothing too intense. I'm running into a problem where I'm trying to populate a blank cell in a row provided the user fills in values to the left of this field.
User will manually populate columns 1-11 on spreadsheet, and column 12 needs to populate a timestamp that is in a static position on the spreadsheet (cell F1). I'd like for the user to be able to populate multiple rows of their data (i.e. A3300 - K3300, A3301 - K3301), and the macro to timestamp the same static value to column 12 in multiple rows (up to the last row the user has populated data). The timestamp should be applied in the scenario that Column A has data and Column L is blank.
Here's the code I currently have - I'm not receiving any errors, but I think there's some circular reference in here that I'm not comprehending. I set i = 3 as the first two rows are locked with the button and timestamp field (=NOW() in Excel). Can you please assist?
Sub Timestamp()
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
TotesRow = Cells(Rows.Count, 12).End(xlUp).Row
For i = 3 To FinalRow
If Cells(i, 12).Value = "" Then
Cells(TotesRow + 1, 12).Value = Range("F1")
End If
Next i
End Sub
Thanks,
JC