Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Nesting multiple subs with If...Then statements

I have a menu system where users can access numerous reports located on
a share drive. The menu is a single UserForm with 3 ListBoxes and 2
OptionButtons. The user makes one geographic zone selection from
ListBox1 that opens and populates ListBox2 with a specific group of
cities. After they make one selection in ListBox2 it opens ListBox3
that has a list of 4 specific reports (Excel files). After they make
their report selection(s) two OptionButtons appear where the user must
select one time period; 12 weeks or 52 weeks.
The results of each of these controls appear on a separate worksheet
called 'inputs'.

When the user makes the final selection from one of the two
OptionButtons it triggers a macro that is supposed to retrieve each of
the selected reports. The problem I'm having is it only retrieves
the first report selected report. Here is the macro that is called up
when the user selects the 12 week OptionButton:

(The code for the requested market falls into cells H10, I10, J10 or
K10 dependant upon which 12 week report(s) they want.)


Sub Check12WkCodes()
Application.ScreenUpdating = False

Sheets("inputs").Select

If Range("H10") < "" Then GetVS12Report
If Range("I10") < "" Then GetCR12Report
If Range("J10") < "" Then GetBR12Report
If Range("K10") < "" Then GetSR12Report

End Sub

Here is some of the 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")

If BR12 = "" Then Exit Sub

'*******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

I have similar code for the remaining 12 week reports. I also have a
similar set of macros covering the 52week selections.

When I began building this the 'GetReport' macros were not
'If...Then' format, they were just one single Excel file. And when
I'd select more than one report from ListBox3, they all appeared.
But when I expanded the 'GetReport' macros to include all the
'If...then' statements it only retrieves the first selection.

I suspect my problem is with the 'Check12WkCodes' macro and I might
have to do something with the 4 'If...Then' statements in this
macro, but I have no idea.

I appreciate any and all help.

TIA

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
Nesting 7 statements Eden397 Excel Discussion (Misc queries) 2 June 5th 08 07:14 PM
Workaround for nesting more than 7 statements campka Excel Discussion (Misc queries) 2 August 15th 06 02:39 PM
Nesting IF statements [email protected] Excel Discussion (Misc queries) 2 March 7th 06 07:43 AM
nesting if statements tjb Excel Worksheet Functions 4 September 9th 05 11:43 PM
Nesting more than nine IF statements in Excel Alexander Walsh via OfficeKB.com Excel Worksheet Functions 13 June 1st 05 06:31 PM


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