Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Text insensitive formula

I have written a Do Loop to change column s when either an Add or Remove have
been added in column Z during a review process. I wanted to write the "IF"
statement to include any form of Upper/Lower case combination of Add or
Remove. i.e. ADD or rEmove. Is this possible or should I add a column to
format the text into proper case in order for the Do Loop to work?

Here is my Do Loop:
Sub AddRemoveRows()
Range("S9").Select
x = ActiveCell.Row
Do While Cells(x, 19).Value 0
If (Cells(x, 26).Text = "add") Then
Cells(x, 19).FormulaR1C1 = "2": x = x + 1
ElseIf (Cells(x, 26).Text = "Remove") Then
Cells(x, 19).FormulaR1C1 = "1": x = x + 1
ElseIf (Cells(x, 26).Text = "") Then x = x + 1
Else
MsgBox "Error in Add/Remove Column. Correct and rerun Save and
Print for Review."
End If
Loop
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Text insensitive formula

Hi
You can do

If (Proper((Cells(x, 26).Text) = "Add") then

and same for Remove
regards
Paul

On Apr 29, 5:24*pm, iashorty
wrote:
I have written a Do Loop to change column s when either an Add or Remove have
been added in column Z during a review process. I wanted to write the "IF"
statement to include any form of Upper/Lower case combination of Add or
Remove. i.e. ADD or rEmove. Is this possible or should I add a column to
format the text into proper case in order for the Do Loop to work?

Here is my Do Loop:
Sub AddRemoveRows()
* * Range("S9").Select
* * x = ActiveCell.Row
Do While Cells(x, 19).Value 0
* * * * If (Cells(x, 26).Text = "add") Then
* * * * Cells(x, 19).FormulaR1C1 = "2": x = x + 1
* * * * ElseIf (Cells(x, 26).Text = "Remove") Then
* * * * Cells(x, 19).FormulaR1C1 = "1": x = x + 1
* * * * ElseIf (Cells(x, 26).Text = "") Then x = x + 1
* * * * * * Else
* * * * * * MsgBox "Error in Add/Remove Column. Correct and rerun Save and
Print for Review."
* * * * End If
* * Loop
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Text insensitive formula

One way:

If LCase(Cells(x, 26).Text) = "add" Then

In article ,
iashorty wrote:

I have written a Do Loop to change column s when either an Add or Remove have
been added in column Z during a review process. I wanted to write the "IF"
statement to include any form of Upper/Lower case combination of Add or
Remove. i.e. ADD or rEmove. Is this possible or should I add a column to
format the text into proper case in order for the Do Loop to work?

Here is my Do Loop:
Sub AddRemoveRows()
Range("S9").Select
x = ActiveCell.Row
Do While Cells(x, 19).Value 0
If (Cells(x, 26).Text = "add") Then
Cells(x, 19).FormulaR1C1 = "2": x = x + 1
ElseIf (Cells(x, 26).Text = "Remove") Then
Cells(x, 19).FormulaR1C1 = "1": x = x + 1
ElseIf (Cells(x, 26).Text = "") Then x = x + 1
Else
MsgBox "Error in Add/Remove Column. Correct and rerun Save and
Print for Review."
End If
Loop
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Text insensitive formula

Something like this maybe...

If StrComp(Cells(x, 26).Text), "Add", vbTextCompare) = 0 Then

Rick


"iashorty" wrote in message
...
I have written a Do Loop to change column s when either an Add or Remove
have
been added in column Z during a review process. I wanted to write the "IF"
statement to include any form of Upper/Lower case combination of Add or
Remove. i.e. ADD or rEmove. Is this possible or should I add a column to
format the text into proper case in order for the Do Loop to work?

Here is my Do Loop:
Sub AddRemoveRows()
Range("S9").Select
x = ActiveCell.Row
Do While Cells(x, 19).Value 0
If (Cells(x, 26).Text = "add") Then
Cells(x, 19).FormulaR1C1 = "2": x = x + 1
ElseIf (Cells(x, 26).Text = "Remove") Then
Cells(x, 19).FormulaR1C1 = "1": x = x + 1
ElseIf (Cells(x, 26).Text = "") Then x = x + 1
Else
MsgBox "Error in Add/Remove Column. Correct and rerun Save and
Print for Review."
End If
Loop
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Text insensitive formula

After working with Proper and LCase, I could not get past "Proper not
defined" and this string worked. Thank you

"Rick Rothstein (MVP - VB)" wrote:

Something like this maybe...

If StrComp(Cells(x, 26).Text), "Add", vbTextCompare) = 0 Then

Rick


"iashorty" wrote in message
...
I have written a Do Loop to change column s when either an Add or Remove
have
been added in column Z during a review process. I wanted to write the "IF"
statement to include any form of Upper/Lower case combination of Add or
Remove. i.e. ADD or rEmove. Is this possible or should I add a column to
format the text into proper case in order for the Do Loop to work?

Here is my Do Loop:
Sub AddRemoveRows()
Range("S9").Select
x = ActiveCell.Row
Do While Cells(x, 19).Value 0
If (Cells(x, 26).Text = "add") Then
Cells(x, 19).FormulaR1C1 = "2": x = x + 1
ElseIf (Cells(x, 26).Text = "Remove") Then
Cells(x, 19).FormulaR1C1 = "1": x = x + 1
ElseIf (Cells(x, 26).Text = "") Then x = x + 1
Else
MsgBox "Error in Add/Remove Column. Correct and rerun Save and
Print for Review."
End If
Loop
End Sub



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
Nested formula to search a text string and return specific text Barbie Excel Worksheet Functions 10 February 21st 09 07:40 AM
Formula Text String: Formatting Text and Numbers? dj479794 Excel Discussion (Misc queries) 5 June 30th 07 12:19 AM
Excel:Get concatenated text to be recognised as formula not text? yvette Excel Discussion (Misc queries) 5 January 15th 07 07:32 PM
VBA and Case Insensitive [email protected] Excel Discussion (Misc queries) 2 March 9th 06 05:32 PM
Formula to count text and alert me if a text appears more than twi Mike Excel Discussion (Misc queries) 1 August 29th 05 09:53 PM


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