Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default exit sub after insert row

Hi the

Please help. The following code dosn't work. Similar code worked perfect
in other cases:

Private Sub MovetoClosedLoan()
Dim selr As Integer

'get selected row
selr = Selection.Row

'insert rows
Worksheets("ClosedLoan").Rows(11).Insert

'copy from loanpipeline to closed loan
Worksheets("LoanPipeLine").Rows(selr).Copy
Worksheets("ClosedLoan").Rows(11)

'delete from loanpipeline
Worksheets("LoanPipeLine").Rows(selr).Delete

'end of sub
End Sub

The execution will stop right after 'insert rows. The rest of the code will
not been executed and no error message.

Thanks.

Xiaoping


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default exit sub after insert row

maybe if you step through your macro, you might find execution does not
actually stop. Instead, maybe your code

Worksheets("ClosedLoan").Rows(11)

is missing the paste method?

"Xiaoping Yao" wrote:

Hi the

Please help. The following code dosn't work. Similar code worked perfect
in other cases:

Private Sub MovetoClosedLoan()
Dim selr As Integer

'get selected row
selr = Selection.Row

'insert rows
Worksheets("ClosedLoan").Rows(11).Insert

'copy from loanpipeline to closed loan
Worksheets("LoanPipeLine").Rows(selr).Copy
Worksheets("ClosedLoan").Rows(11)

'delete from loanpipeline
Worksheets("LoanPipeLine").Rows(selr).Delete

'end of sub
End Sub

The execution will stop right after 'insert rows. The rest of the code will
not been executed and no error message.

Thanks.

Xiaoping



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default exit sub after insert row

or rather pastespecial if applied to a range and paste if applied to the sheet

"Mister T" wrote:

maybe if you step through your macro, you might find execution does not
actually stop. Instead, maybe your code

Worksheets("ClosedLoan").Rows(11)

is missing the paste method?

"Xiaoping Yao" wrote:

Hi the

Please help. The following code dosn't work. Similar code worked perfect
in other cases:

Private Sub MovetoClosedLoan()
Dim selr As Integer

'get selected row
selr = Selection.Row

'insert rows
Worksheets("ClosedLoan").Rows(11).Insert

'copy from loanpipeline to closed loan
Worksheets("LoanPipeLine").Rows(selr).Copy
Worksheets("ClosedLoan").Rows(11)

'delete from loanpipeline
Worksheets("LoanPipeLine").Rows(selr).Delete

'end of sub
End Sub

The execution will stop right after 'insert rows. The rest of the code will
not been executed and no error message.

Thanks.

Xiaoping



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default exit sub after insert row

Checked my previous case involving the same code. Difference is my previous
worksheet doesn't have conditional formating and this one does. Took all
the conditional formating out and the code works perfect. But I do need the
conditional formatting. Seems to me whenever the conditinal formatting is
involved, any of insert and copy method will have trouble. How to get
around with this problem?

Xiaoping
"Xiaoping Yao" wrote in message
news:GBX5d.2944$Ok.2132@okepread04...
Hi the

Please help. The following code dosn't work. Similar code worked perfect
in other cases:

Private Sub MovetoClosedLoan()
Dim selr As Integer

'get selected row
selr = Selection.Row

'insert rows
Worksheets("ClosedLoan").Rows(11).Insert

'copy from loanpipeline to closed loan
Worksheets("LoanPipeLine").Rows(selr).Copy
Worksheets("ClosedLoan").Rows(11)

'delete from loanpipeline
Worksheets("LoanPipeLine").Rows(selr).Delete

'end of sub
End Sub

The execution will stop right after 'insert rows. The rest of the code

will
not been executed and no error message.

Thanks.

Xiaoping




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
Exit Sub Jeff Excel Discussion (Misc queries) 2 March 1st 08 06:21 PM
Run when exit PH NEWS Excel Worksheet Functions 1 July 18th 06 03:53 PM
Exit when its a Mac Tushar Mehta Excel Programming 0 September 21st 04 03:41 PM
Exit when its a Mac jose luis Excel Programming 0 September 20th 04 10:47 PM
If a called sub exit, how to the caller exit right away? luvgreen[_4_] Excel Programming 4 February 24th 04 05:06 PM


All times are GMT +1. The time now is 02:03 AM.

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"