ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   fill A1 when open xsl file (https://www.excelbanter.com/excel-programming/295035-fill-a1-when-open-xsl-file.html)

tpapaj

fill A1 when open xsl file
 
Please how to write macro, which fill cell A1 with text "Hello" whe
open the xsl file

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


Tom Ogilvy

fill A1 when open xsl file
 
use the workbook_Open event. See Chip Pearson's page on events
http://www.cpearson.com/excel/events.htm

Private Sub Workbook_Open()
with Worksheets("Sheet1")
.Range("A1").Value = "Hello"
End With
End Sub

Place this in the thisworkbook module.
--
Regards,
Tom Ogilvy


"tpapaj " wrote in message
...
Please how to write macro, which fill cell A1 with text "Hello" when
open the xsl file?


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




tpapaj[_2_]

fill A1 when open xsl file
 
i'm sorry, but your sample doesnt wor

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


JMay

fill A1 when open xsl file
 
Do you have a Sheet1 in the workbook you are opening?
If not change Tom's code reference to Sheet1 to YourSheetName.

"tpapaj " wrote in message
...
i'm sorry, but your sample doesnt work


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




Frank Kabel

fill A1 when open xsl file
 
Hi
what error did you get or does nothing happen?.
Check if you have places Tom's code into the workbook module (and not
into a standard module)

--
Regards
Frank Kabel
Frankfurt, Germany


i'm sorry, but your sample doesnt work


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



tpapaj[_3_]

fill A1 when open xsl file
 
i'm sorry, it works i didn't paste code into "this sheet

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



All times are GMT +1. The time now is 12:49 PM.

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