Thread: Gosub - Goto ?
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
El Bee El Bee is offline
external usenet poster
 
Posts: 58
Default Gosub - Goto ?

Niek,

I removed the "gosub" and I still get an error.

here's a portion of my code:

While day_name < "XIT"
..
..
ActiveCell.Offset(rowoffset:=0, columnoffset:=-1).Activate
Tsd_title = ActiveCell.Value
color_indx = 0

setcolors

dayname
..
..
..
Wend
Exit Sub

: dayname
Select Case Day_Name
Case "MON"
Start_time_col = 2
Case "TUE"
Start_time_col = 4
..
..
..
return

: setcolors

Select Case Tsd_title
Case "Lead"
color_indx = 10
Case "Super"
color_indx = 5
Case "Tsd"
color_indx = 35
Case "BI"
color_indx = 45
Case "Night"
color_indx = 47
Case "Facilities"
color_indx = 9
Case "Prob Mgmt"
color_indx = 3
End Select

return




"Niek Otten" wrote:

You don't need the gosub (anymore);

Sub test()
test1
MsgBox "after test 1"
End Sub

Sub test1()
MsgBox "test1"
End Sub

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"El Bee" wrote in message ...
| I'm racking my brain; I thought there was a command called gosub that would
| take you to a routine in your macro and then return to the gosub command.
|
| for example.
|
| sub test()
| if x=5 gosub calc_routine
|
| exit sub
|
| : calc_routine
| ' do something
|
| return
| end sub
|
| I've searched this site and MS and I'm stuck.
|
| Thanks