My new plan is the following -
I have a new Sub called output that I pass the Cell reference that calls the sub i.e For the cell A1 it would contain the formula
What I want output to do is check if the cell calling the sub contains a function - which it has to - if so use the Cells.ClearContents method to erase the formula and the Cells.Value to insert a value.
Here's what output looks like -
Sub output(cellReference As Range)
Dim cellcolumn, cellrow
cellcolumn = cellReference.Cells.Column
cellrow = cellReference.Cells.Row
IF(cellreference.HasFormula) Then
'THIS IS WHERE THE PROBLEM IS
'I'M NOT SURE IF THE SYNTAX IS CORRECT
cellReference.Cells.ClearContents
cellReference.Cells.Value = Now
'THE ABOVE DID NOT WORK
'SO I TRIED
Worksheet("Sheet1").Activate
Cells(cellrow,cellcolumn).ClearContents
Cells(cellrow,cellcolumn).Value = Now
END IF
END SUB
It appears as though I can access the properties of the Cells class but can't use the modifiers.
I tried
Worksheet("Sheet1").Activate
Cells(10,10).Value = 666
as a test but nothing happened.
So my question is this - is there anything else I should be doing?
Bookmarks