View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How do I create a excel Template to enter data into same workbook

Use the change event for that cell (where the user enters the date).

http://www.cpearson.com/excel/events.htm

Here is an example that finds the matching date in column 1 of the Different
sheet, then inserts 3 rows below it if found. (as an example)

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng as Range, rng1 as Range, res as Variant
if target.address = "$B$9" Then
With Worksheets("Different")
set rng = .Range(.Cells(2,1),.Cells(rows.count,1).End(xlup))
End with
res = Application.Match(Target,rng,0)
if not iserror(res) then
set rng1 = rng(res)
rng1.offset(1,0).Resize(3).EntireRow.Insert
end if
End if
End Sub

Right click on the Sheet Tab, select view code. and place like the above
code in that module.

--
Regards,
Tom Ogilvy



"PM Rusty" <PM wrote in message
...
I want to create a Template in Excel where date can be entered to create
new
records in the a different sheet in the same workbook. I can't seem to
work
out how to do this in 2003. Help.