Excel VBA Bug

  • Thread starter Thread starter iwl
  • Start date Start date
I

iwl

Hi Group,

can somebody verify the follow bug

Public Function test() As String
ActiveSheet.Range("$P$04:$P$216") = Null
test = ActiveSheet.Range("$A$1").Address
End Function

calling this function in a cell =test()
I get #WERT (German Excel, I think #VALUE
in English as result)

comenting first call out
'ActiveSheet.Range("$P$04:$P$216") = Null

I get $A$1 as expected
 
It is not a bug, you just cannot change part of a worksheet from within a
VBA function called in a worksheet formula.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
A UDF can not modify any cell that it is not in. It is a function in the
truest sense in that it just returns a value. A function called from within
code can modify what it wants, but not a UDF.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top