View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Daniel CHEN Daniel CHEN is offline
external usenet poster
 
Posts: 16
Default Populate a range of cells from a function

Sorry to let you know that you can not use function to change cells'
contents. You need a sub rather than function.

Here is an indirect way without coding:

Assume you will put a number in A1 and the max X you willn enter is 20
in A2 type formula
=IF(ISNUMBER(A1), IF(A1-10,A1-1,""),"")
copy and paste formula to A3:A20
So when you type 10 in A1, A1 to A10 will be filled with 10 to 1 (in reverse
order) and A11 to A20 will be blank.

Hope this helps.


"4eyed" wrote in message
ups.com...
I'm trying to write a function that will populate the cell that called
the function and x number of cells below it. For example

in cell A1, i make a call to my function "=GetList()"

GetList should put the numbers 1 - 10 in cells a1 - a10

its driving me crazy