Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Recgnizing signs 2

Hi again,

I have a lots of cells with different values in them. Mostly it is just
numbers, but sometimes I have <0.30 for example. I am writing a macro in VB,
and I want the cells where the value starts with < to change colour. My
problem is that I cant figure out how to write the program so it can choose
cells where the value starts with <.

How should I do it??

I got the answer to do like this:
Either

if left(Range("A1"),1) = "<" then

or
Mystring = "<ABC"
if Left(MyString,1) = "<" then


but I am very new at this so I can't make it work anyway.. I want it to
look through cells say A1:AA200..


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Recgnizing signs 2

Hi

Look at this:

Sub AAA()
Set TargetRange = Range("A1:AA200")
For Each cell In TargetRange
If Left(cell.Value, 1) = "<" Then
'Your code
End If
Next
End Sub

Regards,
Per


On 8 Jan., 13:49, Ksenija wrote:
Hi again,

I have a lots of cells with different values in them. Mostly it is just
numbers, but sometimes I have <0.30 for example. I am writing a macro in VB,
and I want the cells where the value starts with < to change colour. My
problem is that I cant figure out how to write the program so it can choose
cells where the value starts with <.

How should I do it??

I got the answer to do like this:
Either

if left(Range("A1"),1) = "<" then

or
Mystring = "<ABC"
if Left(MyString,1) = "<" then

*but I am very new at this so I can't make it work anyway.. I want it to
look through cells say A1:AA200..


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Recgnizing signs 2

Thanks:-)!

But now I have a second question, what should I write if I want all these
cells that begin with < to become green or some other color????



"Per Jessen" skrev:

Hi

Look at this:

Sub AAA()
Set TargetRange = Range("A1:AA200")
For Each cell In TargetRange
If Left(cell.Value, 1) = "<" Then
'Your code
End If
Next
End Sub

Regards,
Per


On 8 Jan., 13:49, Ksenija wrote:
Hi again,

I have a lots of cells with different values in them. Mostly it is just
numbers, but sometimes I have <0.30 for example. I am writing a macro in VB,
and I want the cells where the value starts with < to change colour. My
problem is that I cant figure out how to write the program so it can choose
cells where the value starts with <.

How should I do it??

I got the answer to do like this:
Either

if left(Range("A1"),1) = "<" then

or
Mystring = "<ABC"
if Left(MyString,1) = "<" then

but I am very new at this so I can't make it work anyway.. I want it to
look through cells say A1:AA200..



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Recgnizing signs 2

Substitute
'Your code

with

cell.Interior.ColorIndex = 4

Regards,
Per


On 8 Jan., 15:05, Ksenija wrote:
Thanks:-)!

But now I have a second question, what should I write if I want all these
cells that begin with < to become green or some other color????

"Per Jessen" skrev:



Hi


Look at this:


Sub AAA()
Set TargetRange = Range("A1:AA200")
For Each cell In TargetRange
* * If Left(cell.Value, 1) = "<" Then
* * * * 'Your code
* * End If
Next
End Sub


Regards,
Per


On 8 Jan., 13:49, Ksenija wrote:
Hi again,


I have a lots of cells with different values in them. Mostly it is just
numbers, but sometimes I have <0.30 for example. I am writing a macro in VB,
and I want the cells where the value starts with < to change colour. My
problem is that I cant figure out how to write the program so it can choose
cells where the value starts with <.


How should I do it??


I got the answer to do like this:
Either


if left(Range("A1"),1) = "<" then


or
Mystring = "<ABC"
if Left(MyString,1) = "<" then


*but I am very new at this so I can't make it work anyway.. I want it to
look through cells say A1:AA200..- Skjul tekst i anførselstegn -


- Vis tekst i anførselstegn -


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Recgnizing signs 2

Thank you so much:-)!!! Now everything is working:-D!!!

"Per Jessen" skrev:

Substitute
'Your code

with

cell.Interior.ColorIndex = 4

Regards,
Per


On 8 Jan., 15:05, Ksenija wrote:
Thanks:-)!

But now I have a second question, what should I write if I want all these
cells that begin with < to become green or some other color????

"Per Jessen" skrev:



Hi


Look at this:


Sub AAA()
Set TargetRange = Range("A1:AA200")
For Each cell In TargetRange
If Left(cell.Value, 1) = "<" Then
'Your code
End If
Next
End Sub


Regards,
Per


On 8 Jan., 13:49, Ksenija wrote:
Hi again,


I have a lots of cells with different values in them. Mostly it is just
numbers, but sometimes I have <0.30 for example. I am writing a macro in VB,
and I want the cells where the value starts with < to change colour. My
problem is that I cant figure out how to write the program so it can choose
cells where the value starts with <.


How should I do it??


I got the answer to do like this:
Either


if left(Range("A1"),1) = "<" then


or
Mystring = "<ABC"
if Left(MyString,1) = "<" then


but I am very new at this so I can't make it work anyway.. I want it to
look through cells say A1:AA200..- Skjul tekst i anførselstegn -


- Vis tekst i anførselstegn -





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
pound signs awh Excel Discussion (Misc queries) 3 June 28th 07 07:46 PM
Excel to xml- ###### signs [email protected] Excel Discussion (Misc queries) 0 March 12th 07 07:44 PM
# signs where there shouldn't be.... dramajuana Excel Discussion (Misc queries) 1 August 14th 06 10:20 PM
# signs where there shouldn't be.... MarkM Excel Discussion (Misc queries) 0 August 14th 06 07:34 PM
# signs where there shouldn't be.... [email protected] Excel Discussion (Misc queries) 0 August 14th 06 07:29 PM


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