From: Traima on
Hi,

I have a rather basic question: I have made two macros in vb that works out
just fine one by one. Now I need to include one macro into another. I need
the macro called Sub EnterMonthYear to be included at the very end of the Sub
Table

I'm sure there's a simple code to trigger the Sub EnterMonthYear, but I
can't seem to find an answer anywhere..


The programming is like this:

Sub Table ()
..
..
*
End Sub

Sub EnterMonthYear
Dim MyMonth as String
Sheets("Inputsheet").Range("x6").Value=InputBox("Enter month")
Dim MyYear as String
Sheets("Inputsheet").Range("Y6").Value=InputBox("Enter year")
End Sub

Thankful for a response!

Traima
From: Jacob Skaria on
Use the Call Statement which transfers control to a Sub procedure, Function
procedure, or DLL procedure..

Call EnterMonthYear

--
Jacob (MVP - Excel)


"Traima" wrote:

> Hi,
>
> I have a rather basic question: I have made two macros in vb that works out
> just fine one by one. Now I need to include one macro into another. I need
> the macro called Sub EnterMonthYear to be included at the very end of the Sub
> Table
>
> I'm sure there's a simple code to trigger the Sub EnterMonthYear, but I
> can't seem to find an answer anywhere..
>
>
> The programming is like this:
>
> Sub Table ()
> .
> .
> *
> End Sub
>
> Sub EnterMonthYear
> Dim MyMonth as String
> Sheets("Inputsheet").Range("x6").Value=InputBox("Enter month")
> Dim MyYear as String
> Sheets("Inputsheet").Range("Y6").Value=InputBox("Enter year")
> End Sub
>
> Thankful for a response!
>
> Traima
From: steve on
Sub Table ()
.
.
* Call EnterMonthYear *
End Sub


"Traima" <Traima(a)discussions.microsoft.com> wrote in message
news:FD2D79D2-A2BB-4DD2-86EE-EEB0FED88CB4(a)microsoft.com...
> Hi,
>
> I have a rather basic question: I have made two macros in vb that works
> out
> just fine one by one. Now I need to include one macro into another. I
> need
> the macro called Sub EnterMonthYear to be included at the very end of the
> Sub
> Table
>
> I'm sure there's a simple code to trigger the Sub EnterMonthYear, but I
> can't seem to find an answer anywhere..
>
>
> The programming is like this:
>
> Sub Table ()
> .
> .
> *
> End Sub
>
> Sub EnterMonthYear
> Dim MyMonth as String
> Sheets("Inputsheet").Range("x6").Value=InputBox("Enter month")
> Dim MyYear as String
> Sheets("Inputsheet").Range("Y6").Value=InputBox("Enter year")
> End Sub
>
> Thankful for a response!
>
> Traima


From: Traima on
Thanks, both of you.

This immediately solved my problem!

Traima

"steve" wrote:

> Sub Table ()
> .
> .
> * Call EnterMonthYear *
> End Sub
>
>
> "Traima" <Traima(a)discussions.microsoft.com> wrote in message
> news:FD2D79D2-A2BB-4DD2-86EE-EEB0FED88CB4(a)microsoft.com...
> > Hi,
> >
> > I have a rather basic question: I have made two macros in vb that works
> > out
> > just fine one by one. Now I need to include one macro into another. I
> > need
> > the macro called Sub EnterMonthYear to be included at the very end of the
> > Sub
> > Table
> >
> > I'm sure there's a simple code to trigger the Sub EnterMonthYear, but I
> > can't seem to find an answer anywhere..
> >
> >
> > The programming is like this:
> >
> > Sub Table ()
> > .
> > .
> > *
> > End Sub
> >
> > Sub EnterMonthYear
> > Dim MyMonth as String
> > Sheets("Inputsheet").Range("x6").Value=InputBox("Enter month")
> > Dim MyYear as String
> > Sheets("Inputsheet").Range("Y6").Value=InputBox("Enter year")
> > End Sub
> >
> > Thankful for a response!
> >
> > Traima
>
>
> .
>