Language independent way of referencing a "Sheet"?

My friend works as an insurance company analyst and uses Visual Basic for Applications (VBA) to write scripts.

Since her company has offices in different European countries, it should make the scripts as language-independent as possible.

Recently, one problem has appeared: to process Excel documents and refer to sheets (for example, Sheet1, Sheet2) without translating this term into the main European languages.

Does anyone know if Excel can provide a list of constants that it could use to access various pieces of information, regardless of the localized version of Windows / Excel?

Thanks.

+3
source share
2

VBA.

Dim s As Worksheet

For Each s In ActiveWorkbook.Sheets
  DoSomethingWith s
Next s

Set s = ActiveSheet
DoSomethingWith s

Set s = ActiveWorkbook.Sheets.Add()
DoSomethingWith s

Dim i As Long

With ActiveWorkbook.Sheets
  For i = 1 To .Count
    DoSomethingWith .Item(i)
  Next i
End With

, , . VBA. ( ) Excel.

+4

VBA ; , .

wksData wksSummary

wksSummary.Range("A1").Value = "abc"

, VBA .

, :

MsgBox wksSummary.Name
0

Source: https://habr.com/ru/post/1717136/


All Articles