Duplicate User Form in Excel VBA
I want to duplicate form in excel vba, this is necessary because I have applied some formatting to the form and now want all my forms to have the same formatting.
In this way I'll have to only change the "names" of command button in each form and nothing else.
I tried exporting the form and then importing it, but it gives an error saying "The name is already in use"
Any help would be appreciated.
Temporarily change the form name, export it, change the name back, then import the UserForm file. That way they do not match.
Another method:
With your desired workbook open...
Create a new workbook (Ctrl+N) (by default called Book1) then
within the VBA Project window (Ctrl+R),
drag the form you want, and
drop it onto the new workbook VBAProject(Book1). (a small "plus" under the cursor indicates you're doing it right.)
Now Doubleclick the form you just created. (You may need to click the "plus" in front of the Forms folder to display it) and then
in the Properties window (F4) change the "Name" to something unique.
Now back in the VBA Project window
drag and drop this new form back to your original VBAProject.
Done.
For multiple forms repeat the last 2 steps.
ReferenceURL : https://stackoverflow.com/questions/16817764/duplicate-user-form-in-excel-vba
'programing' 카테고리의 다른 글
데이터 프레임에서 변수가 많은 공식을 간단하게 작성하는 방법은 무엇입니까? (0) | 2023.06.18 |
---|---|
GUI 없이 Excel(xls) 파일을 쉼표로 구분된(csv) 파일로 변환 (0) | 2023.06.18 |
MySQL: 다른 테이블의 값에서 테이블의 기존 데이터 "패치" (0) | 2023.06.18 |
int*i와 int*i의 차이 (0) | 2023.06.18 |
웹 API에서 요청과 일치하는 여러 작업이 발견되었습니다. (0) | 2023.06.18 |