Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi. I has a hugh piece of code which was too big to compile, so I have hav had to split it off into separate modules. I keep on getting subscrip out of range errors now. Public I Public p Sub CreateMardakInput() Application.ScreenUpdating = True Sheets("AutoInput").Select Application.CutCopyMode = False ActiveWindow.SelectedSheets.Delete Sheets.Add.Name = "AutoInput" Sheets("AutoInput").Move Befo=Sheets(1) Sheets("AutoInput").Select ' Dim p As Integer p = 2 For I = 1 To Sheets.Count Sheets(I).Select GoSub DoCopy Next I Exit Sub DoCopy: If Cells(1, 1) = "Sub-Contract Payment" Then ' If A1 = LO Templat then: ' Test for name in box link through if so ' for per subcontractor. 'Module3.PartOne (p) 'Module4.PartTwo (p) 'Module5.PartThree (p) 'Module6.PartFour (p) 'Module7.PartFive (p) Call PartOne Call PartTwo Call PartThree Call PartFour Call PartFive End If Return End Sub For some reason the I variable is not picked up by the other modules. have declared I & p as public in these modules. I am stuck. Please help! Thanks, To -- tomjerm ----------------------------------------------------------------------- tomjermy's Profile: http://www.excelforum.com/member.php...fo&userid=2466 View this thread: http://www.excelforum.com/showthread.php?threadid=57419 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Private modules and global variables | Excel Programming | |||
Passing Variables | Excel Discussion (Misc queries) | |||
Help please! Loops? For Each? Variables? | Excel Programming | |||
Passing Variables | Excel Programming | |||
Passing Variables | Excel Programming |