Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
IT IT is offline
external usenet poster
 
Posts: 5
Default Auto add new row

How setup auto add new row when click the box


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Auto add new row

click what box?

"IT" wrote:

How setup auto add new row when click the box



  #3   Report Post  
Posted to microsoft.public.excel.programming
IT IT is offline
external usenet poster
 
Posts: 5
Default Auto add new row

Sorry ...

My Question as .
I am update data in a field. After my mouse click move next field , the
script will atuo insert new row ( included the formula).

"Patrick Molloy" wrote in message
...
click what box?

"IT" wrote:

How setup auto add new row when click the box





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Auto add new row

ok. here is some code. Right click on the sheet TAB and from the menu list
select 'View Code'
Paste the code into the module that opens.


The assumption is that the table begins at cell E9.
When you enter anything in any cell, the CHANGE event fires. This gets the
location on the bottom right cell (saved as lastrow, lastcolumn) . If the
cell that changes has the same address, then the last row is replicated
down...but not the last cell

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lastRow As Long
Dim lastCol As Long
lastRow = Range("E9").End(xlDown).Row
lastCol = Range("E9").End(xlToRight).Column
If Target.Row = lastRow And Target.Column = lastCol And Target.Count = 1 Then
Range(Cells(lastRow, "E"), Cells(lastRow, lastCol - 1)).Copy
Cells(lastRow + 1, "E").PasteSpecial xlPasteAll
End If
End Sub

"IT" wrote:

Sorry ...

My Question as .
I am update data in a field. After my mouse click move next field , the
script will atuo insert new row ( included the formula).

"Patrick Molloy" wrote in message
...
click what box?

"IT" wrote:

How setup auto add new row when click the box






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
Auto-expand/rich auto-complete option in Excel combo boxes Keith Howard Excel Programming 1 March 21st 09 04:16 PM
Auto-populate, Auto-copy or Auto-fill? Jay S. Excel Worksheet Functions 4 August 10th 07 09:04 PM
How to AUTO SAVE as opposed to turning on auto recovery: EXCEL T-mo Excel Discussion (Misc queries) 1 January 12th 06 10:16 PM
Auto Excel workbook close: save= false during an auto subroutine tomwashere2 Excel Programming 10 June 16th 05 06:23 AM
excel links update not working in auto, calculations in auto Mikey Boy Excel Worksheet Functions 0 December 7th 04 11:53 PM


All times are GMT +1. The time now is 03:09 PM.

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"