VBA代码,用于选择活动单元格并更新userform中的数据

时间:2017-02-17 21:34:24

标签: vba

我在userform中有搜索框,如果在搜索框中输入的值引用了sheet1列b10,那么如何将b10行编码为当前行。我把它编码为

If Trim(Me.TextBox_Search_Data.Value) = "," Then
ActiveCell = Cells(Me.TextBox_Search_Data)
ActiveCell.Activate

CurrentRow = ActiveCell.Row

但是这段代码既没有给出任何错误也没有激活当前行

1 个答案:

答案 0 :(得分:0)

你的逻辑不正确。在 { "version": "1.0.0", "name": "aspnet", "private": true, "scripts": { "postinstall": "typings install", "typings": "typings" }, "dependencies": { "@angular/common": "~2.1.0", "@angular/compiler": "~2.1.0", "@angular/core": "~2.1.0", "@angular/forms": "~2.1.0", "@angular/http": "~2.1.0", "@angular/platform-browser": "~2.1.0", "@angular/platform-browser-dynamic": "~2.1.0", "@angular/router": "~3.1.0", "@angular/upgrade": "~2.1.0", "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.20", "@types/core-js": "^0.9.35", "@types/reflect-metadata": "0.0.5", "angular-in-memory-web-api": "~0.1.5", "bootstrap": "^3.3.7", "core-js": "^2.4.1", "jquery": "^3.1.1", "moment": "^2.17.1", "ng2-bootstrap": "^1.3.3", "reflect-metadata": "^0.1.8", "rxjs": "5.0.0-beta.12", "systemjs": "0.19.39", "zone.js": "^0.6.25" }, "devDependencies": { "@types/jquery": "^2.0.40", "gulp": "^3.9.1", "gulp-clean": "^0.3.2", "gulp-concat": "^2.6.0", "gulp-tsc": "^1.2.0", "gulp-typescript": "^2.13.6", "path": "^0.12.7", "typescript": "^2.0.3", "typings": "^1.4.0", "webpack": "^2.2.1" } } 条件下,您正在文本框中检查“,”。如果它有逗号,则文本框不能具有单元格值。可能您必须在If条件中使用其他文本框名称。

尝试以下

If