将验证列表添加到单元格(本地化问题)

时间:2019-06-03 09:13:59

标签: excel vba

我要将验证列表添加到特定的单元格,以便用户可以从下拉列表中进行选择。

每个元素都由//Get the user using uid function getUser() { return (get(/databases/$(database)/documents/users/$(request.auth.uid)).data); } //Check if user exists function isValidUser(user) { return (user != null); } // Check access for your collection match /YourCollection/{id} { allow create: if (isValidUser(getUser()) && request.resource.data.userRef == getUser().uid); } 分隔。这很好。但是,如果使用德语版本的excel,则有时 Dim MyDateYear As Date Dim Cell As Range MyDateYear = Date MyDateYear = DateAdd("m", -24, MyDateYear) For Each Cell In Worksheets("Sheet1").UsedRange.Columns("A").Cells If CDate(Cell.Value) < Format(MyDateYear, "YYYY") Then Me.ListBox1.AddItem Cells(Cell.Row, 2).Value End If Next Cell 是分隔符,有时是,。我不知道该用哪个。

我想向单元格添加一个验证列表。为此,我添加了xlValidateList类型的验证和类似,的公式。

结果是用户可以从如下所示的下拉菜单中进行选择:

;

但是有时在德文版的excel中,此列表只有一个元素,内容为:

"eggs,milk,apples"

我已经尝试检查excel设置为哪种语言,如果它是德语,则将“,”替换为“;”。这有效,但仅在某些时候。其他时间(重新启动excel后)应该再次eggs milk apples

我用于设置列表的代码:

eggs,milk,apples

convertToLocale函数基本上检查,是否等于ws.Cells(16, column) = vbNullString ws.Cells(16, column).Validation.Delete ws.Cells(16, column).Validation.Add Type:=xlValidateList, Formula1:=convertToLocale(portListAsString) ws.Cells(16, column).Select 并将Application.LanguageSettings.LanguageID(msoLanguageIDUI)替换为1031。有时输出是预期的,有时是: ,

谢谢

1 个答案:

答案 0 :(得分:0)

这项工作对您有用吗

 public void update(float dt) {
    handleInput(dt);
    world.step(1/60f, 6, 2);
    // world is done processing physics
    // loop through array and move objects
    gameCam.update();
    player.update();
    creator.updateCocoNuts(dt);
}

我的荷兰语系统使用分号,但是从来没有任何问题可以替换VBA中的通用逗号。