Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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

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
Hopefully easy macro question Brad Excel Programming 0 July 10th 08 07:09 PM
probably a relatively easy macro question.... [email protected] Excel Programming 2 December 19th 07 01:27 AM
Macro fill down question, I think its easy Still Learning Excel Programming 5 August 21st 06 07:11 PM
Easy question: Have macro ignore #N/A Paul987[_19_] Excel Programming 2 March 27th 06 09:27 PM
An easy macro question and one I believe to be a little more diffi TroutKing Excel Worksheet Functions 3 January 18th 05 09:17 PM


All times are GMT +1. The time now is 07:54 AM.

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

About Us

"It's about Microsoft Excel"