Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Brad1982
 
Posts: n/a
Default Changing certain text within a cell


I make a production schedule on a daily basis and it has anywhere from
60-120 SKU's per day. I am running into the problem of having too many
SKU's that are similar to eachother within one cell. This makes it hard
for me to double check my schedule without looking very closely at each
letter.

A1 would contain this
TBLUE(50)
THMBLU(60)
THBLU(10)
THMBLU(47)

Is there a formula I could use to color the prefix "THM" blue? I could
then make the prefix "TH" a different color etc etc.. I want to avoid
doing this manually as it would be quite time consuming for 120 SKU's.


--
Brad1982
------------------------------------------------------------------------
Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690
View this thread: http://www.excelforum.com/showthread...hreadid=526815

  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Changing certain text within a cell

This is very easy if you use VBA:

Sub only_blue()
Dim L As Long
For L = 1 To 100
If Left(Cells(L, 1).Value, 3) = "THM" Then
Cells(L, 1).Characters(Start:=1, Length:=3).Font.ColorIndex = 5
End If
Next L
End Sub

This little program runs down the first 100 cells in column A and, if they
start with THM, will make the THM blue.

You can adjust the limits to suit your needs.
--
Gary's Student


"Brad1982" wrote:


I make a production schedule on a daily basis and it has anywhere from
60-120 SKU's per day. I am running into the problem of having too many
SKU's that are similar to eachother within one cell. This makes it hard
for me to double check my schedule without looking very closely at each
letter.

A1 would contain this
TBLUE(50)
THMBLU(60)
THBLU(10)
THMBLU(47)

Is there a formula I could use to color the prefix "THM" blue? I could
then make the prefix "TH" a different color etc etc.. I want to avoid
doing this manually as it would be quite time consuming for 120 SKU's.


--
Brad1982
------------------------------------------------------------------------
Brad1982's Profile: http://www.excelforum.com/member.php...o&userid=15690
View this thread: http://www.excelforum.com/showthread...hreadid=526815


  #3   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default Changing certain text within a cell

That only works if there is a single string in the cell:

A1 = THMBLU(20)

A1 would contain this
TBLUE(50)
THMBLU(60)
THBLU(10)
THMBLU(47)


Biff

"Gary''s Student" wrote in message
...
This is very easy if you use VBA:

Sub only_blue()
Dim L As Long
For L = 1 To 100
If Left(Cells(L, 1).Value, 3) = "THM" Then
Cells(L, 1).Characters(Start:=1, Length:=3).Font.ColorIndex = 5
End If
Next L
End Sub

This little program runs down the first 100 cells in column A and, if they
start with THM, will make the THM blue.

You can adjust the limits to suit your needs.
--
Gary's Student


"Brad1982" wrote:


I make a production schedule on a daily basis and it has anywhere from
60-120 SKU's per day. I am running into the problem of having too many
SKU's that are similar to eachother within one cell. This makes it hard
for me to double check my schedule without looking very closely at each
letter.

A1 would contain this
TBLUE(50)
THMBLU(60)
THBLU(10)
THMBLU(47)

Is there a formula I could use to color the prefix "THM" blue? I could
then make the prefix "TH" a different color etc etc.. I want to avoid
doing this manually as it would be quite time consuming for 120 SKU's.


--
Brad1982
------------------------------------------------------------------------
Brad1982's Profile:
http://www.excelforum.com/member.php...o&userid=15690
View this thread:
http://www.excelforum.com/showthread...hreadid=526815




  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Changing certain text within a cell

You are correct Biff:

If ther are multiple strings within A1 containing THM, then the code would
update only the leading instance. In that case:

1. copy the material to a Word doc.
2. use find/replace in Word to change THM into THM (blue)
3. copy the material back into Excel

--
Gary's Student


"Biff" wrote:

That only works if there is a single string in the cell:

A1 = THMBLU(20)

A1 would contain this
TBLUE(50)
THMBLU(60)
THBLU(10)
THMBLU(47)


Biff

"Gary''s Student" wrote in message
...
This is very easy if you use VBA:

Sub only_blue()
Dim L As Long
For L = 1 To 100
If Left(Cells(L, 1).Value, 3) = "THM" Then
Cells(L, 1).Characters(Start:=1, Length:=3).Font.ColorIndex = 5
End If
Next L
End Sub

This little program runs down the first 100 cells in column A and, if they
start with THM, will make the THM blue.

You can adjust the limits to suit your needs.
--
Gary's Student


"Brad1982" wrote:


I make a production schedule on a daily basis and it has anywhere from
60-120 SKU's per day. I am running into the problem of having too many
SKU's that are similar to eachother within one cell. This makes it hard
for me to double check my schedule without looking very closely at each
letter.

A1 would contain this
TBLUE(50)
THMBLU(60)
THBLU(10)
THMBLU(47)

Is there a formula I could use to color the prefix "THM" blue? I could
then make the prefix "TH" a different color etc etc.. I want to avoid
doing this manually as it would be quite time consuming for 120 SKU's.


--
Brad1982
------------------------------------------------------------------------
Brad1982's Profile:
http://www.excelforum.com/member.php...o&userid=15690
View this thread:
http://www.excelforum.com/showthread...hreadid=526815





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
Can you keep text from one cell showing over the next cell? Sean VandeWall Excel Discussion (Misc queries) 2 February 22nd 06 08:20 PM
Shade cell according to text? Ltat42a Excel Discussion (Misc queries) 0 January 3rd 06 06:37 PM
edit number in cell without it changing to text rklremote Excel Discussion (Misc queries) 1 May 19th 05 10:22 PM
On click, copy text into another cell - XL2K Bob the Builder Excel Worksheet Functions 2 March 16th 05 10:03 PM
Why is my text changing to pound signs? SleepyDawn Excel Discussion (Misc queries) 2 February 9th 05 10:52 PM


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