Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Lista Forumurilor Pe Tematici
|
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login
POZE MRRRR'S FORUM (VIEW ONLY)
Nu sunteti logat.
|
Nou pe simpatie: Cezi pe Simpatie.ro
 | Femeie 21 ani Vaslui cauta Barbat 23 - 80 ani |
|
TRaP
Moderator
Inregistrat: acum 7 ani
Postari: 840
|
|
If you want to dynamically (using a button) insert the VBA code required for this:
You need the following code in your personal.xlsb:
' You need to go to TOOLS - REFERENCES and add the following library: ' Microsoft Visual Basic for Applications Extensibility 5.3
Sub Z_2AddCodeToSht() Dim wb As Workbook Dim ws As Worksheet Dim xPro As VBIDE.VBProject Dim xCom As VBIDE.VBComponent Dim xMod As VBIDE.CodeModule Dim xLine As Long
Set wb = ActiveWorkbook Set ws = ActiveSheet
With wb Set xPro = .VBProject Set xCom = xPro.VBComponents(ws.CodeName) '.CodeName for VB sheet name; .Name for Excel tab names Set xMod = xCom.CodeModule
With xMod xLine = .CreateEventProc("SelectionChange", "Worksheet") xLine = xLine + 1 .InsertLines xLine, " Target.Calculate" End With End With
End Sub |
The following snippet will be inserted: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Target.Calculate
End Sub
Modificat de TRaP (acum 6 ani)
|
|
pus acum 6 ani |
|