Don't see why VBA compiler says --> Compiler error Expected:"="

Semanon

New Member
Joined
Dec 5, 2013
Messages
7
Hi,

I would expect this is it was regarding a 'function' call but it's for a 'sub'. I'm trying to execute "createSomeLunchBreaks "...


Code:
            If (agentsOnBreak \ 13)  < Num_Agents_Per_Break Then
             
                createSomeLunchBreaks (lunchDuration, _
                                         agentRow, dateCol, _
                                         longLunchAgents, theName)

This is the sub that is executed by above ...

Code:
Sub createSomeLunchBreaks(lunchDuration As Integer, _
                                agentRow As Integer, _
                                dateCol As String, _
                                longLunchAgents() As String, _
                                theName As String)
   
    If break_length = longLunchDuration Then
        addLongBreak
    Else
        addShortBreak
    End If
        
End Sub



Any clues much appreciated :)
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,216
Office Version
  1. 365
Platform
  1. Windows
Remove the brackets in the call to the sub.
Code:
         createSomeLunchBreaks lunchDuration, _
                                         agentRow, dateCol, _
                                         longLunchAgents, theName
 

Watch MrExcel Video

Forum statistics

Threads
1,122,335
Messages
5,595,569
Members
413,996
Latest member
mabelO

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top