Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Returning values to calling sub

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 Sub
---------------------------------------------------------------------------------
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumif using Values, but returning text or values Jose Excel Discussion (Misc queries) 1 April 14th 10 09:01 PM
Mactching Values & Returning Values Akash Excel Programming 0 March 28th 07 10:18 AM
Returning Values Harlan Excel Discussion (Misc queries) 1 December 12th 06 10:19 PM
Calling a function and then returning CLamar Excel Discussion (Misc queries) 4 June 19th 06 06:47 PM
Sorting unique values and returning values from a formula MarcusA Excel Programming 2 March 1st 06 05:36 AM


All times are GMT +1. The time now is 10:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"