Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Getting the last line of data in a data sheet.


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving a line chart data point revises data table value in Excel ' Ed Smith Charts and Charting in Excel 2 November 16th 12 01:03 PM
Copy data into new line on seperate sheet? sarah Excel Discussion (Misc queries) 1 May 12th 09 08:11 PM
Formatting data series - line between certain data points only alan_m Charts and Charting in Excel 0 September 20th 07 05:16 PM
Adding an Average line (from data sheet) to a chart automatically. Judi Charts and Charting in Excel 5 January 4th 07 01:31 PM
Entering 1 line of data values that will show up in a second Sheet? iomighty[_2_] Excel Programming 1 June 3rd 04 12:47 AM


All times are GMT +1. The time now is 01:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"