How do I create a excel Template to enter data into same workbook
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. |
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. |
All times are GMT +1. The time now is 06:39 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com