View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DFS DFS is offline
external usenet poster
 
Posts: 5
Default UserForm closes after Selection.Insert (RESOLVED)

Excel 2003

I have a form with a button that inserts one row. As soon as the Insert
executes, the form closes and the code quits.

i = ActiveCell.Row
Rows(i + 1).Select
Selection.Insert

I also tried: Rows(i + 1).Insert
on the last line, and no dice.


Resolution: close the sheet and reopen and it works.

Lesson learned: Excel sometimes works in mysterious ways.