Tuesday, January 25, 2011

Ultimate 32 Bit Ct4780

Make a custom function to automatically update

write after, I received an interesting query about how to have a function that we created in VBA, is updated by itself, since not all features are updated alone.

For example the following code:



obtain the name of the current sheet, you can copy and paste the code in a VBA module and calls the function by writing = N_Archivo1 () . At the end you will find an Excel file with the examples. We then returned as text us the name of the sheet, but if we change the name of the sheet you will see that the function does not update itself, you can select the cell and F2 + ENTER keys will update the name.

see that this procedure is uncomfortable, especially if you have the custom function in Excel VBA different parts of the sheet to make the function set to update automatically or alone, add the method . Volatile to function, the code would be as follows:



Then if that we call the function N_Archivo2 () to change the name of the worksheet cell value changes automatically. You can download Excel file with the functions mentioned here .

0 comments:

Post a Comment