View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Getting the last line of data in a data sheet.

Hi Ken,

Try:

'=============
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim rng As range

Set WB = ActiveWorkbook '<<==== CHANGE
Set SH = WB.Sheets("Sheet2")
Set rng = SH.Cells(Rows.Count, "B").End(xlUp)

rng.Copy Destination:=WB.Sheets("Sheet1").range("A1")

End Sub
'<<=============


---
Regards,
Norman


"sungen99" wrote in
message ...

I have a running list of data in a worksheet2 where column B contains
the date of the data.

What I would like is a macro that will find the last line of data in
worksheet2, get the date in that last line column B and plant it on
worksheet1 A1.

Thanks very much,
Ken


--
sungen99
------------------------------------------------------------------------
sungen99's Profile:
http://www.excelforum.com/member.php...fo&userid=9144
View this thread: http://www.excelforum.com/showthread...hreadid=513658