Returning values to calling sub

E

El Bee

I'm not sure what I'm doing wrong here. the first sub calls the second sub
which sets 2 vars (prog_name & Levels). These values are not being returned
to the calling sub.

thanks for looking.

see below.


Public Next_Prog, Last_Prog, Start_add As Variant
Public ProgName, Levels As String
----------------------------------------------------------------------------
Sub Step2_Extract_Profiles()
Dim logOn, Prof_row, Row_nbr, Last_row As Variant
Dim copy_From, ProgName, Levels As String

Dim rCell As Range
Dim cell As Range

Range("A2").Select
Prog_row = ActiveCell.Row
Selection.End(xlDown).Select
Last_prog = ActiveCell.Row
Range("A2").Select
ProgName = ActiveCell.Value
Levels = ActiveCell.Offset(0, 1)
ActiveCell.Offset(1, 0).Select
next_prog = ActiveCell.Address

Range("D4").Select
Row_nbr = ActiveCell.Row
Start_add = ActiveCell.Address
Selection.End(xlDown).Select
Last_row = ActiveCell.Row
Range(Start_add).Select
Do While ActiveCell.Row <= Last_row
If ActiveCell.Value = ProgName Then
End If
GoSub Set_Prg_Name
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Su
---------------------------------------------------------------------------------
Sub Set_Prg_Name()
Range(next_prog).select
if activecell.row > Last_prog then
else
ProgName = ActiveCell.Value
Levels = ActiveCell.Offset(0,1)
ActiveCell.Offset(1, 0).Select
next_prog = ActiveCell.Address 'values change here but are not
returned to calling sub
end if
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top