Ил
Ильгам

Statement invalid outside Type block?? Ошибка в VBA. Ошибка относится к строке: Dim b as Integer

ИБ
Ира Берегова

Sub ppp()
Dim b As Integer
End Sub

у меня VBA не ругнулся)) )
приведите плииз весь текст проги)) )

а система помощи VBA выдала, отдайте на растерзание гугл-транслейту:

Statement invalid outside Type block

The syntax for declaring variables outside a Type...End Type statement block is different from the syntax for declaring the elements of the user-defined type. This error has the following causes and solutions:

You tried to declare a variable outside a Type...End Type block or outside a statement.
When declaring a variable with an As clause outside a Type...End Type block, use one of the declaration statements, Dim, ReDim, Static, Public, or Private. For example, the first declaration of

MyVar

in the following code generates this error; the second and third declarations of
MyVar

are valid:

MyVar As Double ' Invalid declaration syntax.

Dim MyVar As Double

Type AType
MyVar As Double ' This is valid declaration syntax
End Type ' because it's inside a Type block.

You used an End Type statement without a corresponding Type statement.
Check for an unmatched End Type, and either precede its block with a Type statement, or delete the End Type statement if it isn't needed.

Похожие вопросы
Делаю програму в которой есть строка if ( for (b=0; b<10; b++) { p >= *chislo && p >= *(chislo+b); }) что не так строк
Программка на delphi ошибка invalid floating point
Код VBA работает с ошибкой, почему?
Через какую програму можно решить эту задачку? Dim А (1 То 5) As Integer
помогите пожжжж!! ! Дополните оператор объявления типа Dim theVar As _____ чтобы переменная theVar имела тип строка
как задать условие на ошибку в синтаксисе VBA
VBA ExcelКак программно выловить удаление любой строки?
Ошибка VBA "For without Next"
Поиск номеров строк VBA Exel
Только начал изучать vba. в чем моя ошибка в программе?