Auto insert a row or cell

E

excel2000

I'm entering numbers under a colum, I need the total sum of the colum;
But after I enter the last number 221 and press enter it needs to skip
with a blank row or cell ? but allways adding the total sum at the last
cell.
After the 221 and press enter, the cursor will go to the next cell
below, which the total sum is located; I need a blank cell so it will
skip to the next cell where I will enter the next number.

Thank you very much.
JA
ex:
123
222
111
221
---> Here is where I need the blank row allways
677 This is the total sum

File Attached: http://www.excelforum.com/attachment.php?postid=329397 (book1.xls)
 
B

Bernie Deitrick

excel2000,

I didn't open your attached workbook - they are rarely if ever
needed - but you can use the code below to do that. Right click the
sheet tab, select "View Code" and paste this code into the window that
appears.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Left(Target(2).Formula, 5) = "=SUM(" Then Target(2).Insert (xlDown)
End Sub


excel2000 said:
I'm entering numbers under a colum, I need the total sum of the colum;
But after I enter the last number 221 and press enter it needs to skip
with a blank row or cell ? but allways adding the total sum at the last
cell.
After the 221 and press enter, the cursor will go to the next cell
below, which the total sum is located; I need a blank cell so it will
skip to the next cell where I will enter the next number.

Thank you very much.
JA
ex:
123
222
111
221
---> Here is where I need the blank row allways
677 This is the total sum

File Attached:
http://www.excelforum.com/attachment.php?postid=329397 (book1.xls)
 
B

Bernie Deitrick

I should have noted that this requires that you have the option to
auto extend lists and formulas turned on (Excel 2000 and up).

HTH,
Bernie
MS Excel MVP

Bernie Deitrick said:
excel2000,

I didn't open your attached workbook - they are rarely if ever
needed - but you can use the code below to do that. Right click the
sheet tab, select "View Code" and paste this code into the window that
appears.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Left(Target(2).Formula, 5) = "=SUM(" Then Target(2).Insert (xlDown)
End Sub


excel2000 said:
I'm entering numbers under a colum, I need the total sum of the colum;
But after I enter the last number 221 and press enter it needs to skip
with a blank row or cell ? but allways adding the total sum at the last
cell.
After the 221 and press enter, the cursor will go to the next cell
below, which the total sum is located; I need a blank cell so it will
skip to the next cell where I will enter the next number.

Thank you very much.
JA
ex:
123
222
111
221
---> Here is where I need the blank row allways
677 This is the total sum

File Attached:
http://www.excelforum.com/attachment.php?postid=329397 (book1.xls)
 
I

immanuel

Consider evaluating XL2003. The list functionality is greatly improved and
includes a feature akin to what you describe.

/i.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Blank row 1
Blank row 1
Macro sum 1
insert row not taken into account by sum box 6
Index and Match 5
how to insert serial numbers to rows? 3
Macroto delete extra space in a cell 3
The adventure with Autosum 1

Top