0

In column A I have several values. As values ​​are added or removed, in excel vba I want to extract all values ​​from column A down to the last value

How can i create this?

Werte = Sheets("Messauswertung").Range("A1:A100").Value

This is not a the optimal way

Thanks!

braX
  • 11,506
  • 5
  • 20
  • 33
Green
  • 1
  • 2

1 Answers1

1

On way is

dim lastRow as Long
With Sheets("Messauswertung")
   lastRow = .Cells(rows.Count, 1).End(xlUp).Row 'last used row
   Werte = .Range("A1:A" & lastRow).Value
End With

By the way, each sheet has a .Name but also a .CodeName (Sheet1).
I find it much better to (eventually change the CodeName and) use that one.
Easier to read, to write, and protected from name changes by users.

iDevlop
  • 24,841
  • 11
  • 90
  • 149