excel - VBA global variables -


itemprop = "text">

The following code to deal with UserForms on my spreadsheet VBA macro:

  Public saved_vocab string public saved_num string public_type saved_def as public form string public private string Save_Click () Low dim integer dim integer dim as high as selected as integer low = 1 high = cells (1, 1) Saved_ex as .End (xlDown) Find the line range (cells (lower, 1), cell (high, 1)) (after: = vocab.Text, after: = ActiveCell, see: = xlFormulas, _ lookAt: = xlPart, SearchOrder: = XlByRows, SearchDirection: = xlNext, _ MatchCase: = false, SearchFormat: = false) .Activate selected = ActiveCell.Row saved_vocb = cells (selected, 1) .text saved_num = cells (selected, 2) .text saved_def = cells , 3). Text saved_ex = cells (selected, 4) .text cells (selected, 1) = vocab.Text cells (selected, 2) = num.Text cells (selected, 3) = definition.Text cells (selected, 4) = exampl e .Text End Sub Personal sub-undo_Click () cells (selected, 1) = saved_vocab cells (selected, 2) = saved_num cells (selected, 3) = saved_def cells (selected, 4) = saved_ex End Sub  

What I want to do is save information properly in Saved _ ??? String value so that I can use it properly when I decide to click on the "Undo" button to execute another function. However, when I execute another function, the saved info in the saved _ ??? Variables are hardly B / C which are handling the variable scripts inappropriately. What I want to do is the easiest way to complete it? Thanks in advance for the advice.

I think you want to insert global variable in 'normal' module, no sheet module


Comments