Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

2 sub

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
raraschek - 21 Jun 2007 20:18 GMT
hi i´ve got two subroutines: the first looks like
Sub SME_novaRubrika()

Dim rubrika As String
Dim datum As String
datum = InputBox("Zadaj datum pre clanky", "DATUM", 2004)
rubrika = InputBox("Zadaj nazov rubriky pre clanky", "RUBRIKA")

then i have another subroutine, in which i want to use actually assigned
variable datum from the first subroutine. thanks for help
Bear - 22 Jun 2007 23:51 GMT
Raraschek:

You can dimension the variables at the module level, rather than at the
subroutine level. Then all subroutines in the module can access the variables.

Bear
Signature

Windows XP, Word 2000

> hi i´ve got two subroutines: the first looks like
> Sub SME_novaRubrika()
[quoted text clipped - 6 lines]
> then i have another subroutine, in which i want to use actually assigned
> variable datum from the first subroutine. thanks for help
Bear - 22 Jun 2007 23:54 GMT
Raraschek:

You can dimension the variables at the module level (in the Declarations
section) rather than in the subroutines. That way all subroutines in the
module can access the variables.

Bear
Signature

Windows XP, Word 2000

> hi i´ve got two subroutines: the first looks like
> Sub SME_novaRubrika()
[quoted text clipped - 6 lines]
> then i have another subroutine, in which i want to use actually assigned
> variable datum from the first subroutine. thanks for help
Doug Robbins - Word MVP - 23 Jun 2007 05:49 GMT
Delete the

Dim rubrika As String
Dim datum As String

and at the top of the code window, insert

Public rubrika As String
Public datum As String

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> hi i´ve got two subroutines: the first looks like
> Sub SME_novaRubrika()
[quoted text clipped - 6 lines]
> then i have another subroutine, in which i want to use actually assigned
> variable datum from the first subroutine. thanks for help
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.