Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've got the following code working fine as a result of some wonderful
feedack from members., I just run the macro until it runs out of data to find. The only problem is that when there is no more data to find, the macro ends as an error. Is there any way of ending the macro "cleanly"when there are no more entries? Thanks again for the help. Paul Sub Pastedetails() ' Cutpaste Macro ' Macro recorded 22/11/2005 by IT Services ' ' Keyboard Shortcut: Ctrl+x Sheets("Posting").Activate x = Columns(3).Find("Reconciliations - Outstanding Items").Row y = Columns(3).Find("Account Balance - Per master File").Row z = Sheets("Posting").Cells(Rows.Count, "a").End(xlUp).Row + 1 Rows(x & ":" & y).Cut Sheets("Summary").Activate ActiveCell.SpecialCells (xlCellTypeLastCell) ActiveSheet.Paste Cells.Select Cells.EntireColumn.AutoFit Windows("Suspense1.xls").Activate ActiveCell.SpecialCells(xlCellTypeLastCell).Offset (1, -5).Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ending Macro in Last Row within a column of Printable Items | Excel Worksheet Functions | |||
Ending a macro early conditionally on one cell being blank | Excel Discussion (Misc queries) | |||
Ending zero | Excel Discussion (Misc queries) | |||
Ending Looping Macro | Excel Programming | |||
macro not ending | Excel Programming |