Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    milton keynes, Buckinghamshire
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    passing variables (2003)

    The following code operated quite happily until I made the change of adding in the additional ProjectBudget variable, to be passed from the ExportMultipleProjects Sub to the ProjectCostDetail2 sub. Now when I attampt to run ExportMultipleProjects one of the following syntax error alerts apperas
    Expected )
    Expected =
    Syntax error

    Can someone please tell me where the problem lies.

    Public Sub ExportMultipleProjects()
    Dim ProjectName As String
    Dim ProjectBudget As Long

    ColCounter = 1
    ProjectBudget = 0
    RowCounter = 5
    While Cells(RowCounter, ColCounter).Value <> ""
    ProjectName = Cells(RowCounter, ColCounter).Value
    ProjectBudget = Cells(RowCounter, (ColCounter + 1)).Value
    ProjectCostDetailMod2.ProjectCostDetail2 (ProjectName, ProjectBudget)

  2. #2
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    milton keynes, Buckinghamshire
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: passing variables (2003)

    All

    I have managed to answer my own question. When calling a sub-routine and passing multiple variables you do not put brackets around the variables, which is a different process from when you are calling a function which requires multiple variables to be passed to it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •