ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to run a Sub while opening the xls file (what event to use)? (https://www.excelbanter.com/excel-programming/286254-how-run-sub-while-opening-xls-file-what-event-use.html)

ira

How to run a Sub while opening the xls file (what event to use)?
 
i need to initialise some values while opening a file.

Also how to move down the cells when pasting (not deleting them)?
paste data to a range a1:a5 and there is already some data. i want t
move it to a6:a10 and paste new data to a1:a5. Is there any easy way t
do this while using the Paste method

--
Message posted from http://www.ExcelForum.com


Ron de Bruin

How to run a Sub while opening the xls file (what event to use)?
 
You can use the Workbook open event

Check out this site about events
http://www.cpearson.com/excel/events.htm


You can use this line to insert 5 rows
Range("a1").Rows.Resize(5).EntireRow.Insert


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"ira" wrote in message ...
i need to initialise some values while opening a file.

Also how to move down the cells when pasting (not deleting them)? i
paste data to a range a1:a5 and there is already some data. i want to
move it to a6:a10 and paste new data to a1:a5. Is there any easy way to
do this while using the Paste method?


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 12:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com