Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 28th, 2012, 11:13 PM
Registered User
 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default error when puting more than 1 string

Hello, I'm a newbie in Excel VBA, this may sound stupid but I encounter error with the below code, whats wrong?


Public Sub callDisplayTest()

displayTest ("First", "Second")

End Sub


Public Sub displayTest(firstStr as String, secondStr as String)

MsgBox (firstStr)
MsgBox (secondStr)

End Sub
 
Old July 29th, 2012, 09:41 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Use either of the following:

Code:
displayTest "First", "Second"
Call displayTest("First", "Second")
Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error for Special char in a string il_betto VBScript 1 February 16th, 2011 05:41 AM
Error Inserting string containing (') and (,) Dom55 SQL Server 2000 6 June 1st, 2007 03:31 PM
Unterminated string constant error mateenmohd Classic ASP Basics 2 May 30th, 2007 02:36 AM
The BeerHouse 'Connection String Error' nesrine C# 1 March 21st, 2007 01:28 AM
Error in formula: A string is required here JMak15 Crystal Reports 0 March 11th, 2004 09:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.