View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 279
Default Duplicate declaration in scope

In message of Tue, 10 Jan 2012 15:23:25
in microsoft.public.excel.programming, Hebs
writes

I am having troubles with this code please help.
its giving me the duplicate declaration in scope error.

Sub EnterSave(PanSize, PanName, CartNum, Dwidth, ProdName)
Dim Jobnum As Long
Dim DoorNum As Long
Dim PanName As Long
Jobnum = CartForm.JobTxt.Value


PanName is both a parameter of EnterSave and a variable within it.
That is why the code gets a duplicate declaration.
I believe PanSize is equivalent to Byref PanSize as Variant.
Is that what is intended?
What is CartForm?
There are good reasons to start all code with Option Explicit

A stand alone example might cause the answer to leap out.
That would save the effort of waiting for an answer.
--
Walter Briscoe