 |
 |

06-25-2003, 04:30 AM
|
 |
Centurion
|
|
Join Date: Mar 2003
Location: Germany
Posts: 131
|
|
Userform Name
|
hi
i wonder if there is a way to get the name of the active userform in another macro
i have a userform and when i click a commandbutton it runs a macro(application.run)
this macro adds a new sheet and i want the sheets name to be the name of the userform but i dont get it
i think i have to make the name of the userform public so that the macro can use the variable
or get the userforms name with the macro code but i cant
any solutions?
|
__________________
Ater Sanguis is watching you - and the Wisdom of the Dragon helps him!
|

06-25-2003, 08:13 AM
|
 |
Green-Eyed
Super Moderator * Guru *
|
|
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
|
|
|
strNewWorksheetName = Me.Name
|
|

06-25-2003, 10:53 AM
|
 |
Centurion
|
|
Join Date: Mar 2003
Location: Germany
Posts: 131
|
|
|
thanx for your reply timbo
but its not what im looking for
the new sheet (added from a macro in a modul) should have the name of the Form
and because its a seperate macro the variables defined by the form are deleted and the form is inactive so that i cant use Me
|
__________________
Ater Sanguis is watching you - and the Wisdom of the Dragon helps him!
|

06-26-2003, 07:03 AM
|
 |
Green-Eyed
Super Moderator * Guru *
|
|
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
|
|
|
If the procedure is launched from a command button on the form, you can pass the variable to it. Look up the 'Sub' statement in your VB Help...
|
|

06-26-2003, 08:06 AM
|
 |
Centurion
|
|
Join Date: Mar 2003
Location: Germany
Posts: 131
|
|
Quote: Originally Posted by Timbo If the procedure is launched from a command button on the form, you can pass the variable to it. Look up the 'Sub' statement in your VB Help...
ive looked there but i saw nothing helpful
i try to describe my problem a better way
i have a userform with a commadbutton
if i click on the commandbutton
a procedure is been launched
(to insert several data into a sheet)
and this sheet has to be created first
this should happen by a macro (in a modul[like you use the macrorecorder])
and this macro is launched by a line in the procedure
(with Application.Run "macro")
and because of this i cannot use the variables i define in the procedure
and i cannot access the userform from the macro
but i need the name of the userform because the new sheet should have the same
hope it is more clearly
|
__________________
Ater Sanguis is watching you - and the Wisdom of the Dragon helps him!
|

06-27-2003, 02:56 PM
|
|
Newcomer
|
|
Join Date: May 2003
Location: Iowa, USA
Posts: 9
|
|
|
This might work--
Before you run the macro, open the new application and set the caption of the application window with the same name as the form.
Then in the macro you call, use application.caption to get the name.
or, open the application and create and name a new document or worksheet before running the macro in that application.
-MJMJ
|
|

06-28-2003, 04:02 AM
|
 |
Centurion
|
|
Join Date: Mar 2003
Location: Germany
Posts: 131
|
|
|
its a bit long winded but it works
thanx mjmj
|
__________________
Ater Sanguis is watching you - and the Wisdom of the Dragon helps him!
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Initial values in userform from bookmarks
|
carina |
Word, PowerPoint, Outlook, and Other Office Products |
0 |
06-17-2003 09:17 AM |
|
Taking over a filename to a userform
|
Artifi |
Excel |
0 |
03-28-2003 07:59 AM |
|
Two game plays selection on one userform
|
rip |
Word, PowerPoint, Outlook, and Other Office Products |
9 |
02-09-2003 09:00 AM |
|
Unload of userform
|
rip |
Word, PowerPoint, Outlook, and Other Office Products |
10 |
01-08-2003 07:18 AM |
|
UserForm Word/VB
|
CS1 |
Word, PowerPoint, Outlook, and Other Office Products |
2 |
07-13-2002 03:08 PM |
|
|
|
|
|
 |
|