LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Single Macro containing multiple subs

I'm trying to write a macro that will check numerous 'If.. Then'
statements and if the condition is met it goes out to a share point and
retrieves a specific Excel file. As soon as it opens that file it
returns to the original macro and checks the next If..then statement.
If the condition is met it retrieves the report, otherwise it goes on
to the next If...Then.

Unfortunately I can't get past the first If...Then statement.

Here's what my macro looks like so far:

Sub Check12WkCodes()
Application.ScreenUpdating = False

Sheets("inputs").Select
'****if condition is met opens Varietal Summary
If Range("H10") < "" Then GetVS12Report

'****if condition is met opens Class Rank
If Range("I10") < "" Then GetCR12Report

'****if condition is met opens Brand Rank
If Range("J10") < "" Then GetBR12Report

'****if condition is met opensSku Rank
If Range("K10") < "" Then GetSR12Report


End Sub


Here is an example of the corresponding code for the Brand Rank report:



Sub GetBR12Report()
'***These are the brand ranks

Application.ScreenUpdating = False

Sheets("Inputs").Select
Dim BR12 As Range
Set BR12 = Range("J10")

'*******NATIONAL Selections...
If BR12 = 1 Then TUS_FOOD
If BR12 = 2 Then TUS_DRUG
If BR12 = 3 Then TUS_FOOD_DRUG
If BR12 = 4 Then TUS_FD_DRG_LIQ

'*****This continues to cover over 200 different geographic selections

End Sub


Here's an example of the corresponding market selections

Sub TUS_FOOD ()
Workbooks.Open Filename:= _
"\\MyDirectory\reports\Brand Ranks\tus food.xls"
End Sub

I appreciate any ideas.

Thank you,

 
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
Nesting multiple subs with If...Then statements [email protected] Excel Programming 0 June 26th 06 02:06 AM
Excel macro for multiple series in a single scatter graph using 3 columns trumptmast Excel Programming 7 May 15th 06 06:49 PM
Macro for single to multiple cols. Help! dfkelly42 New Users to Excel 5 July 1st 05 09:07 PM
Exiting Multiple Subs? SS Excel Programming 0 June 2nd 05 08:22 PM
Variable holding across multiple subs? Mark Excel Programming 9 April 7th 05 07:45 PM


All times are GMT +1. The time now is 10:05 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"