Last Cell

  • Thread starter Thread starter PeterLai
  • Start date Start date
P

PeterLai

I want to assign the value of A1 = the last cell of col B which is changing
when a new entry is added.
How can I do it but writing simple programme.
 
Hi
if you don't have blank rows in between you may try the
following formula in A1
=OFFSET($B$1,COUNTA(B:B)-1,0)
 
Hi Peter,
I want to assign the value of A1 = the last cell of col B which is changing
when a new entry is added.
How can I do it but writing simple programme.

put the following procedure in the code module of the sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub
Application.EnableEvents = False
Range("A1").Value = Target.Value
Application.EnableEvents = True
End Sub

--
Mit freundlichen Grüssen

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top