When you open the spreadsheet there is no date in Column Q. I've put in code to auto fill Column Q with a Now() structure. I then coded Column A to look at Column Q and if empty to take the date in Column Q and to make Column A to show "FY18 Budget Authority" based on the date in Column Q. When I run the code I get NO errors, Column Q does populate with the date in MM/DD/YYYY format but Column A does nothing, stays empty. I'm sure there is better way to write both of the code please help.
'This part put in the date based on todays date (wish it would only fill in date if B Column has information in it)
Range("Q1").Select
ActiveCell.FormulaR1C1 = "Date"
date_test = Now()
Range("Q2:Q300").Select
Range("Q2:Q300") = Format(date_test, "yyyy/mm/dd")
On Error Resume Next
If Range("f2").Value = "" Then
For Each ws In ThisWorkbook.Sheets
ws.Range("f2").Value = Date
Next ws
'code for Column A to look at column Q to fill with FY18 Budget Authority
Set ws = Sheets("SOFData")
lr = ws.Cells(Rows.Count, "Q").End(xlUp).Row
For x = 2 To lr
If IsEmpty(Cells(x, "A")) Then
FY = Right(Year(Cells(x, "A")), 2)
Cells(x, "A") = "FY" & FY & " Budget Authority"
End If
Next x
[/code]
'This part put in the date based on todays date (wish it would only fill in date if B Column has information in it)
Range("Q1").Select
ActiveCell.FormulaR1C1 = "Date"
date_test = Now()
Range("Q2:Q300").Select
Range("Q2:Q300") = Format(date_test, "yyyy/mm/dd")
On Error Resume Next
If Range("f2").Value = "" Then
For Each ws In ThisWorkbook.Sheets
ws.Range("f2").Value = Date
Next ws
'code for Column A to look at column Q to fill with FY18 Budget Authority
Set ws = Sheets("SOFData")
lr = ws.Cells(Rows.Count, "Q").End(xlUp).Row
For x = 2 To lr
If IsEmpty(Cells(x, "A")) Then
FY = Right(Year(Cells(x, "A")), 2)
Cells(x, "A") = "FY" & FY & " Budget Authority"
End If
Next x
[/code]