Hi!
I am using this script but it can only read text with small letters. Can I
change it to read with both small and big letters:
Case Is = "i13"
If LCase(.Value) = LCase("select door") Then
'skipit
End If
Hi!
I am using this script but it can only read text with small letters. Can I
change it to read with both small and big letters:
Case Is = "i13"
If LCase(.Value) = LCase("select door") Then
'skipit
End If
Hi Calle,
Using LCase on both sides of the comparison expression reders the test case
insensitive and, consequently, your code should accept the sought text in
any casr, or mix of cases.
---
Regards,
Norman
"Calle" <[email protected]> wrote in message
news:[email protected]...
> Hi!
> I am using this script but it can only read text with small letters. Can I
> change it to read with both small and big letters:
>
> Case Is = "i13"
> If LCase(.Value) = LCase("select door") Then
> 'skipit
> End If
ok, thx I try that. one more question. Is ther a way to get a script to
delete content in merged cells. I can only get the script to delete in
normal cells.
script:
Case Is = "i17"
If LCase(.Value) = LCase("clear") Then
Selection.Offset(1, -2).ClearContents
Else
Hi Calle,
Try:
Case Is = "i17"
If LCase(.Value) = LCase("clear") Then
With Selection.Offset(1, -2)
If .MergeCells Then
.MergeArea.ClearContents
Else
.ClearContents
End If
End With
Else
---
Regards,
Norman
"Calle" <[email protected]> wrote in message
news:[email protected]...
> ok, thx I try that. one more question. Is ther a way to get a script to
> delete content in merged cells. I can only get the script to delete in
> normal cells.
>
> script:
>
> Case Is = "i17"
> If LCase(.Value) = LCase("clear") Then
> Selection.Offset(1, -2).ClearContents
> Else
One way:
Selection.Offset(1, -2).value = ""
Calle wrote:
>
> ok, thx I try that. one more question. Is ther a way to get a script to
> delete content in merged cells. I can only get the script to delete in
> normal cells.
>
> script:
>
> Case Is = "i17"
> If LCase(.Value) = LCase("clear") Then
> Selection.Offset(1, -2).ClearContents
> Else
--
Dave Peterson
thx for the reply !
Hi Dave,
A much simpler answer!
I never use merged cells - and it shows!
---
Regards,
Norman
"Dave Peterson" <[email protected]> wrote in message
news:[email protected]...
> One way:
> Selection.Offset(1, -2).value = ""
I would think that this would work, too:
Selection.Offset(1, -2).MergeArea.ClearContents
even if the range isn't merged.
(untested, though)
Norman Jones wrote:
>
> Hi Dave,
>
> A much simpler answer!
>
> I never use merged cells - and it shows!
>
> ---
> Regards,
> Norman
>
> "Dave Peterson" <[email protected]> wrote in message
> news:[email protected]...
> > One way:
> > Selection.Offset(1, -2).value = ""
--
Dave Peterson
If you put
Option Compare Text
at the very top of your module, text comparisons are
automatically done case-insensitive, so there is no need for the
conversion to LCase.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Calle" <[email protected]> wrote in message
news:[email protected]...
> Hi!
> I am using this script but it can only read text with small
> letters. Can I
> change it to read with both small and big letters:
>
> Case Is = "i13"
> If LCase(.Value) = LCase("select door") Then
> 'skipit
> End If
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks