I want to set value for cells by VBA. I have googled, and see some resolution:

```
Sheets("SheetName").Range("A1").value = someValue
Sheets("SheetName").Cells(1,1).value = someValue

```

With this kind of code, I can just read data from cell A1 but I cannot set a new value to it. 

*Update*

The code to set cell A1 value is put within a `Function` as below.

```
Function abb()
    Sheets("SheetName").Range("A1").value = 122333
    abb = 'any thing'
End Function

```

In cell B2, I set `=abb()` and hit enter. I get #VALUE but nothing happen at A1.

Putting this code in a macro, it works.

My question is, how to make A1 have values within a function?