Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
range function
i am trying to create a function that will change the calculation of each
cell in a range. i want to be able to call this function using different ranges at different times. Public Function DivideRange(TheRange As Range, c As Range) Set TheRange = Range("x:y") For Each c In TheRange c.Value = c / 1000 Next c End Function I am not sure how to get this to work. I have posted what I have created thus far. Any suggestions would be helpful. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
range function
You cannot change a worksheet from within a function. A function can only
return a value which replaces its call. You may try a Sub, but you'll have to figure out which event(s) should trigger it. Also, you'll have to pass a range as one argument or use a different construct. But Range("x:y") will not work. Maybe you can post what you're trying to achieve. -- Kind regards, Niek Otten Microsoft MVP - Excel "Monique" wrote in message ... i am trying to create a function that will change the calculation of each cell in a range. i want to be able to call this function using different ranges at different times. Public Function DivideRange(TheRange As Range, c As Range) Set TheRange = Range("x:y") For Each c In TheRange c.Value = c / 1000 Next c End Function I am not sure how to get this to work. I have posted what I have created thus far. Any suggestions would be helpful. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
function range | Excel Worksheet Functions | |||
DBSUM function but with function as criterion, not a range | Excel Worksheet Functions | |||
range function | Excel Discussion (Misc queries) | |||
IF function for a value range | Excel Discussion (Misc queries) | |||
Translate range name passed as string to a custom function to range addresses! | Excel Programming |