Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Anthony
 
Posts: n/a
Default printing from Excel data

Hi,
Can anybody suggest some VB code that will allow me to select the LAST row
of data entered into a worksheet and print just this info, example


SMITH 123 JONES 456
JONES 897 SMITH 019
PAUL 876 PHIL 124

So I wish to select the last row of data ie PAUL 876 PHIL 124 and print
this in a separate form already produced on a separate sheet

Hope you can help

regards


  #2   Report Post  
SteveF
 
Posts: n/a
Default

Anthony wrote:
Hi,
Can anybody suggest some VB code that will allow me to select the

LAST row
of data entered into a worksheet and print just this info, example


SMITH 123 JONES 456
JONES 897 SMITH 019
PAUL 876 PHIL 124

So I wish to select the last row of data ie PAUL 876 PHIL 124 and

print
this in a separate form already produced on a separate sheet

Hope you can help

regards



Assuming your data is in columns A-D of sheet1 and your "separate form"
starts
in B2 of Sheet2 then this code should work:

Sub printlast()
lastrow = Sheets("Sheet1").Range("a65536").End(xlUp).Row
Set fromrange = Sheets("sheet1").Range(Cells(lastrow, 1), _
Cells(lastrow, 4))
fromrange.Copy Sheets("sheet2").Range("b2")
End Sub

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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Help with data not getting plotted Scott Ehrlich Charts and Charting in Excel 1 January 23rd 05 05:15 PM
Fetching External Data from Excel Sri Excel Discussion (Misc queries) 2 January 3rd 05 11:46 AM
When printing labels by using Excel data in a Word mail merge, ho. Jerry Excel Discussion (Misc queries) 2 January 2nd 05 01:27 PM
Refreshing Access data in Excel Jimmy G Excel Discussion (Misc queries) 0 December 21st 04 03:53 PM


All times are GMT +1. The time now is 01:52 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"