Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
queries in excel
if we have a file in excel and there is a cell starting in number 1 and when
i want to close this sheet and reopen it again i wanna be 2 by auto ,so each time i open this file i wanna this number to be increased automatically |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
queries in excel
Press Alt + F11 to open the VBE and then double click the ThisWorkbook object
in the project window. In the Code pane change the value in the combo box on the left to Workbook and the value in the combobox on the right to Open. Enter the following line of code in the Workbook_Open() event Sheets(1).Range("A1").Value = Sheets(1).Range("A1").Value + 1 Change the worksheet's index number to the reference the sheet you're wanting to track the number of times the workbook is opened and the cell address you want the total in. Sheets can also be referenced by their tab name as follows. Sheets("Sheet1").Range("A1").Value = Sheets("Sheet1").Range("A1").Value + 1 -- Kevin Backmann "gaby elia" wrote: if we have a file in excel and there is a cell starting in number 1 and when i want to close this sheet and reopen it again i wanna be 2 by auto ,so each time i open this file i wanna this number to be increased automatically |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
queries in excel
This will increment cell A1 in worksheet Sheet1:
Private Sub Workbook_Open() With Sheets("Sheet1").Range("A1") .Value = .Value + 1 End With End Sub This event macro goes in the workbook code area. -- Gary''s Student - gsnu200789 "gaby elia" wrote: if we have a file in excel and there is a cell starting in number 1 and when i want to close this sheet and reopen it again i wanna be 2 by auto ,so each time i open this file i wanna this number to be increased automatically |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel queries | Excel Worksheet Functions | |||
Excel 2007 queries | Excel Discussion (Misc queries) | |||
Excel web queries using parameters | Excel Discussion (Misc queries) | |||
Excel Queries | Links and Linking in Excel | |||
Web Queries Excel 97 | Excel Discussion (Misc queries) |