Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
Help with data not getting plotted | Charts and Charting in Excel | |||
Fetching External Data from Excel | Excel Discussion (Misc queries) | |||
When printing labels by using Excel data in a Word mail merge, ho. | Excel Discussion (Misc queries) | |||
Refreshing Access data in Excel | Excel Discussion (Misc queries) |