Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hopefully easy macro question
Can
If UCase(shtInput.Range("RiskT")) = "FIXED" Then Module3.SetPagesFixed End If If UCase(shtInput.Range("RiskT")) = "VARIABLE" Then Module3.SetPagesVariable End If This be condensed to one line - something like? Module3.SetPages & shtInput.Range("RiskT").value -- Wag more, bark less |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hopefully easy macro question
You can do
Select Case shtInput.Range("RiskT") Case "FIXED": Module3.SetPagesFixed Case "VARIABLE": Module3.SetPagesVariable End Select -- __________________________________ HTH Bob "Brad" wrote in message ... Can If UCase(shtInput.Range("RiskT")) = "FIXED" Then Module3.SetPagesFixed End If If UCase(shtInput.Range("RiskT")) = "VARIABLE" Then Module3.SetPagesVariable End If This be condensed to one line - something like? Module3.SetPages & shtInput.Range("RiskT").value -- Wag more, bark less |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hopefully easy macro question
Application.Run "Module3.SetPages" & shtInput.Range("RiskT").value
-- Regards, Tom Ogilvy "Brad" wrote: Can If UCase(shtInput.Range("RiskT")) = "FIXED" Then Module3.SetPagesFixed End If If UCase(shtInput.Range("RiskT")) = "VARIABLE" Then Module3.SetPagesVariable End If This be condensed to one line - something like? Module3.SetPages & shtInput.Range("RiskT").value -- Wag more, bark less |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hopefully easy macro question
You could condense it like:
If UCase(shtInput.Range("RiskT")) = "FIXED" Then Module3.SetPagesFixed elseIf UCase(shtInput.Range("RiskT")) = "VARIABLE" Then Module3.SetPagesVariable End If Or if those are the only two options that could be in RiskT: If UCase(shtInput.Range("RiskT")) = "FIXED" Then Module3.SetPagesFixed else Module3.SetPagesVariable End If or you could use Select Case if you want to support lots of options: select case UCase(shtInput.Range("RiskT")) case is = "FIXED" : Module3.SetPagesFixed case is = "VARIABLE" : Module3.SetPagesVariable End If I'd use one of these before I'd use this--but this is valid: application.run "Module3.SetPages" & shtInput.Range("RiskT") Brad wrote: Can If UCase(shtInput.Range("RiskT")) = "FIXED" Then Module3.SetPagesFixed End If If UCase(shtInput.Range("RiskT")) = "VARIABLE" Then Module3.SetPagesVariable End If This be condensed to one line - something like? Module3.SetPages & shtInput.Range("RiskT").value -- Wag more, bark less -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hopefully easy macro question
Thanks to all - I will be using the select case logic
-- Wag more, bark less "Dave Peterson" wrote: You could condense it like: If UCase(shtInput.Range("RiskT")) = "FIXED" Then Module3.SetPagesFixed elseIf UCase(shtInput.Range("RiskT")) = "VARIABLE" Then Module3.SetPagesVariable End If Or if those are the only two options that could be in RiskT: If UCase(shtInput.Range("RiskT")) = "FIXED" Then Module3.SetPagesFixed else Module3.SetPagesVariable End If or you could use Select Case if you want to support lots of options: select case UCase(shtInput.Range("RiskT")) case is = "FIXED" : Module3.SetPagesFixed case is = "VARIABLE" : Module3.SetPagesVariable End If I'd use one of these before I'd use this--but this is valid: application.run "Module3.SetPages" & shtInput.Range("RiskT") Brad wrote: Can If UCase(shtInput.Range("RiskT")) = "FIXED" Then Module3.SetPagesFixed End If If UCase(shtInput.Range("RiskT")) = "VARIABLE" Then Module3.SetPagesVariable End If This be condensed to one line - something like? Module3.SetPages & shtInput.Range("RiskT").value -- Wag more, bark less -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hopefully easy macro question | Excel Programming | |||
probably a relatively easy macro question.... | Excel Programming | |||
Macro fill down question, I think its easy | Excel Programming | |||
Easy question: Have macro ignore #N/A | Excel Programming | |||
An easy macro question and one I believe to be a little more diffi | Excel Worksheet Functions |