Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am sorry if this is a too basic question. Unfortunately I couldnot find a solution so far. I wish to write a function in VBA which would modify the cells (which is passed as a parameter) and also return a value. Something like this: Public Function macro1(add As Range)as String add.Select Selection.Value = 10 macro1="hello" End Function But this does not work. "add.Select" does not seem to have any effect. But if I write it as a Sub, it works Public Sub macro1(add As Range) add.Select Selection.Value = 10 End Sub But I actually need this to be a function. Any help or pointer would be greatly appreciated. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Modify range of cells at once... | New Users to Excel | |||
Modify search function | Excel Worksheet Functions | |||
Modify range variable passed through Function | Excel Programming | |||
How a function can modify a value from some cells ? | Excel Programming | |||
Can I modify a Hyperlink with a function? | Excel Discussion (Misc queries) |