View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Brad Brad is offline
external usenet poster
 
Posts: 846
Default 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