Hi,
I am trying to transfer data to an external file from a worksheet using VBA: current date, username and a global range named cell "Score". Date and username is succesfully transfered to column A and B in the first empty row. "Score" however gives me an error. I don't know how to refer to it. It's working globally in my worksheet.
So far I have tried to use = Range("Score") instead of [Score].Value, but it's not working either. Any ideas?
I am trying to transfer data to an external file from a worksheet using VBA: current date, username and a global range named cell "Score". Date and username is succesfully transfered to column A and B in the first empty row. "Score" however gives me an error. I don't know how to refer to it. It's working globally in my worksheet.
Code:
Dim emptyRow As Long
'Find first empty row in open file
emptyRow = WorksheetFunction.CountA(.Range("A:A")) + 1
'Transfer data to column A, B & C
.Cells(emptyRow, 1).Value = Format(Now(), "mm/dd/yyyy")
.Cells(emptyRow, 2).Value = Environ("UserName")
.Cells(emptyRow, 3).Value = [Score].Value
So far I have tried to use = Range("Score") instead of [Score].Value, but it's not working either. Any ideas?