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: 15
Default If ElseIf statement can not adapt to new data?

Hi,

I'm using the code below to enter the word 'more' or 'less' within a
particular cell, contingent upon the numerical values within two other cells.
It works when I run the macro once, but if one alters the values within the
two numerical cells, and the macro is run again, the code does not adjust to
change the word 'more' or 'less'. It seems to get stuck with repeating the
same 'less' or 'more' over and over again (irrespective of the numercial
values within the cells)? Any ideas how the code can be modified so that it
can be run more than once? Thanks.

If ("Compare_Role!B16.Text") ("Compare_Role!C16.Text") Then
Range("Compare_Role!E16") = "more"
ElseIf ("Compare_Role!B16.Text") < ("Compare_Role!C16.Text") Then
Range("Compare_Role!E16") = "less"
End If
 
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
handling error in IF ELSEIF statement Sabosis Excel Programming 1 April 30th 09 12:27 AM
How may actionable items can you have under an ElseIf Statement Martin888 Excel Programming 4 November 21st 07 08:21 PM
How to simplify If / ElseIf statement Ksu Excel Programming 2 October 11th 06 05:04 PM
How to simplify If / ElseIf statement Ksu Excel Programming 4 October 8th 06 09:26 AM
ElseIf Statement problem Erik K via OfficeKB.com[_2_] Excel Programming 5 December 23rd 05 12:51 PM


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