Answer the question
In order to leave comments, you need to log in
How to put the values of the selected cells into an array?
Good afternoon, how to use VBA to enter the values of the selected cells into an array for further use?
PS Cells with values can have a different location, as in the picture below.
Answer the question
In order to leave comments, you need to log in
Selecting a range to enter
DIm DataCell as Range
On Error Resume Next
For Each DataCell in Selection
If DataCell.Value<>0 Then 'При условии, что значения могут быть только числовые. Иначе делаем проверки или, как я, забиваем на них с помощью On Error Resume Next
'Приченяем добро: добавляем данные в динамический массив, в коллекцию, в другие ячейки и т.п.
End If
Next
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question