View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
yogendra joshi yogendra joshi is offline
external usenet poster
 
Posts: 48
Default Autofill & Lookup Function

You can also do this without selecting....

sub fill_last()
Range(Range("E65536").End(xlUp).Offset(0, -4), _
Range("A65536").End(xlUp)).Value = _
Range("A65536").End(xlUp).Value
End Sub

Tom Ogilvy wrote:

As best I can make out, this should do it. Use column E to find the last
cell and use column A to find the last registration number.

Dim rng as Range, rng1 as Range
set rng = Cells(rows.count,1).End(xlup)
set rng1 = Cells(rows.count,5).End(xlup)
Range(rng,rng1.offset(0,-4)).Value = rng.Value