Please how to write macro, which fill cell A1 with text "Hello" whe open the xsl file
T tpapaj Apr 14, 2004 #1 Please how to write macro, which fill cell A1 with text "Hello" whe open the xsl file
T Tom Ogilvy Apr 14, 2004 #2 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.
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.
J JMay Apr 14, 2004 #4 Do you have a Sheet1 in the workbook you are opening? If not change Tom's code reference to Sheet1 to YourSheetName.
Do you have a Sheet1 in the workbook you are opening? If not change Tom's code reference to Sheet1 to YourSheetName.
F Frank Kabel Apr 14, 2004 #5 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)
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)