View Single Post
  #2   Report Post  
Old March 9th 10, 09:08 PM posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2007
Posts: 11,501
Default macro to generate next number

Hi,

Yuo can have a macro if you want but you don't need one, try this

=OFFSET(Sheet2!A1,COUNTA(Sheet2!A:A)-1,0)
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"puiuluipui" wrote:

Hi, i need a macro to look in sheet 2 column A and look at the last filled
cell. In the last filled cell i have a number. When i run macro, i need to
generate (in sheet1 A1) the number from the last filled cell +1.

EX:
sheet 2 last filled cell = 29
sheet1 after macro i need to have in A1 = 30

Can this be done?
Thanks!