2 sub

R

raraschek

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
 
B

Bear

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
 
B

Bear

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
 
D

Doug Robbins - Word MVP

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


--
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top