Weird. Am I crazy or does VB .NET not work that way? I seem to remember
always using parentheses.
Oh, and thanks.It works now
"Trevor Shuttleworth" wrote:
> Try without the brackets:
>
> Private Sub NewMonthButton_Click()
> Dim shtName As String
> shtName = "Corrugator"
> ShiftNewMonth 1, shtName
> End Sub
>
> Regards
>
> Trevor
>
>
> "Rayo K" <RayoK@discussions.microsoft.com> wrote in message
> news:87FEAA29-4561-484A-8CFE-882AB9E939F0@microsoft.com...
> >I just added a variable to a sub in a module. It used to receive an
> >integer.
> > Now it receives an integer and a string.
> >
> > Excel won't let me pass the string to it. I don't know what is going on.
> > Here is my sub first line:
> >
> > Public Sub ShiftNewMonth(MachineType As Integer, MachineName As String)
> > ...
> > End Sub
> >
> >
> >
> >
> > I call this sub from a worksheet like this:
> >
> > Private Sub NewMonthButton_Click()
> > Dim shtName As String
> > shtName = "Corrugator"
> > ShiftNewMonth (1 , shtName)
> > End Sub
> >
> > Excel wants me to put an equal sign at the end of "ShiftNewMonth (1 ,
> > shtName)" as if it's a Function.
> >
> > If I remove the string and say: ShiftNewMonth (1), it lets it go, but then
> > it doesn't work because the module is expecting a string. ?????
>
>
>
Bookmarks