P
plh
Hello Everyone,
I thought this would be easy, but I must have something fundamentally wrong.
The following function has various cell-clearing test code lines in it, but none
have any effect on the contents of the cell. I have tried many other ways to do
it besides what is below.
Function ClearIt(v As Double) As Boolean
ActiveWorkbook.ActiveSheet.Range("MyData").Select
Selection.ClearContents
ActiveWorkbook.ActiveSheet.Range("MyData").ClearContents
'Range("C5").Value = ""
ActiveWorkbook.ActiveSheet.Cells(5, 3).ClearContents
End Function
Changes to C5 fire the function as D5 contains =ClearIt(C5). My ultimate goal
is to have a change to any of the cells in the range "MyData" fire "ClearIt"
which will decide whether or not to clear the cells based on a set of logical
rules. But I am stuck on what I thought was a very simple test! Can anyone help
me?
Thanx,
-plh
I thought this would be easy, but I must have something fundamentally wrong.
The following function has various cell-clearing test code lines in it, but none
have any effect on the contents of the cell. I have tried many other ways to do
it besides what is below.
Function ClearIt(v As Double) As Boolean
ActiveWorkbook.ActiveSheet.Range("MyData").Select
Selection.ClearContents
ActiveWorkbook.ActiveSheet.Range("MyData").ClearContents
'Range("C5").Value = ""
ActiveWorkbook.ActiveSheet.Cells(5, 3).ClearContents
End Function
Changes to C5 fire the function as D5 contains =ClearIt(C5). My ultimate goal
is to have a change to any of the cells in the range "MyData" fire "ClearIt"
which will decide whether or not to clear the cells based on a set of logical
rules. But I am stuck on what I thought was a very simple test! Can anyone help
me?
Thanx,
-plh