vba无法在textbox controlsource属性中键入简单函数

时间:2016-03-17 11:43:02

标签: vba properties textbox controls

我是VBA的新手。 我构建了一个带有多个文本框的userform,它们根据组合框选择返回一个值。

所以在文本框控件源属性中,我可以编写像“= index(match)and stuff”这样的公式 但不能写像“= sheet1!b4 + sheet1!c7”

我得到“无法设置controlsource属性,无效的属性值”错误 我的公式当然比这更复杂,(如果我在普通单元格中键入它们,它们就可以工作)..但似乎我不能在CONTROLource属性中写入任何计算符号+ - * /

任何想法为什么????

1 个答案:

答案 0 :(得分:0)

那是因为那时的电池是连接的#34;到文本框。如果您更新文本框,则还要更新#include <SDL.h> #include <stdio.h> const int SCREEN_WIDTH = 1920; const int SCREEN_HEIGHT = 1080; SDL_Window* gWindow; SDL_Renderer* gRenderer; SDL_Texture* gTexture; SDL_Event e; void* gPixels = NULL; int gPitch = SCREEN_WIDTH * 4; bool gExitFlag = false; Uint64 start; Uint64 end; Uint64 freq; double seconds; int main(int argc, char* args[]) { SDL_Init(SDL_INIT_VIDEO); gWindow = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL); gRenderer = SDL_CreateRenderer(gWindow, -1, SDL_RENDERER_ACCELERATED); // | SDL_RENDERER_PRESENTVSYNC); vsync is turned off gTexture = SDL_CreateTexture(gRenderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, SCREEN_WIDTH, SCREEN_HEIGHT); while (!gExitFlag) { while (SDL_PollEvent(&e) != 0) { if (e.type == SDL_QUIT) { gExitFlag = true; } } start = SDL_GetPerformanceCounter(); SDL_LockTexture(gTexture, NULL, &gPixels, &gPitch); *((uint32_t*)gPixels) = 0xff000ff; SDL_UnlockTexture(gTexture); //20-100ms on different hardware end = SDL_GetPerformanceCounter(); freq = SDL_GetPerformanceFrequency(); SDL_RenderCopy(gRenderer, gTexture, NULL, NULL); SDL_RenderPresent(gRenderer); gPixels = NULL; gPitch = 0; seconds = (end - start) / static_cast<double>(freq); printf("Frame time: %fms\n", seconds * 1000.0); } SDL_DestroyWindow(gWindow); SDL_DestroyRenderer(gRenderer); SDL_DestroyTexture(gTexture); SDL_Quit(); return 0; } 上的链接单元格。但是,如果您尝试使用sheet1链接两个单元格,之后您正在更改文本框中的值,那么Excel将无法知道要更新的单元格。应该只更新Sheet1B4还是只更新Sheet1C7?也许这两个细胞都获得50%的价值?

简而言之:一个文本框只能有一个控制源,从而将文本框链接到引用的单元格。