Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Concatenation 2 Texts

Suppose I have two Texts: "Text1" in A1 and "Text2" in C1. I want to make a
concatenation of A1 and C1 in cell C3, and make the font of "Text1" bold, but
not "Text2". Is there a way to do this in Excel?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Concatenation 2 Texts

You would need VBA.

With ActiveCell
.Value = Range("A1").Value & Range("C1").Value
.Characters(Len(Range("A1").Value) + 1, _
Len(Range("C1").Value)).Font.Bold = True
End With


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hi_no_Tori" wrote in message
...
Suppose I have two Texts: "Text1" in A1 and "Text2" in C1. I want to make

a
concatenation of A1 and C1 in cell C3, and make the font of "Text1" bold,

but
not "Text2". Is there a way to do this in Excel?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Concatenation 2 Texts

Tanks a lot, Bob. It works, but... I need "Text1" to be bold not "Text2" and
I need to seperate between "text1" and "Text2" e.g. by the sign: "-". I'll be
very thankful if you can help.

"Bob Phillips" wrote:

You would need VBA.

With ActiveCell
.Value = Range("A1").Value & Range("C1").Value
.Characters(Len(Range("A1").Value) + 1, _
Len(Range("C1").Value)).Font.Bold = True
End With


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hi_no_Tori" wrote in message
...
Suppose I have two Texts: "Text1" in A1 and "Text2" in C1. I want to make

a
concatenation of A1 and C1 in cell C3, and make the font of "Text1" bold,

but
not "Text2". Is there a way to do this in Excel?




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Concatenation 2 Texts

No problem

With ActiveCell
.Value = Range("A1").Value & "-" & Range("C1").Value
.Characters(1, Len(Range("A1").Value) ) _
.Font.Bold = True
End With


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hi_no_Tori" wrote in message
...
Tanks a lot, Bob. It works, but... I need "Text1" to be bold not "Text2"

and
I need to seperate between "text1" and "Text2" e.g. by the sign: "-". I'll

be
very thankful if you can help.

"Bob Phillips" wrote:

You would need VBA.

With ActiveCell
.Value = Range("A1").Value & Range("C1").Value
.Characters(Len(Range("A1").Value) + 1, _
Len(Range("C1").Value)).Font.Bold = True
End With


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hi_no_Tori" wrote in message
...
Suppose I have two Texts: "Text1" in A1 and "Text2" in C1. I want to

make
a
concatenation of A1 and C1 in cell C3, and make the font of "Text1"

bold,
but
not "Text2". Is there a way to do this in Excel?






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Concatenation 2 Texts

Once again, thank you very much for your help and your fast response Bob. I
tried it and it works... But I still need some help. I need the concatenation
to be in a fixed cell (e.g. D12), instead of the active cell... I tried the
following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Range("D12")
.Value = Range("A1").Value & "-" & Range("C1").Value
.Characters(1, Len(Range("A1").Value)) _
.Font.Bold = True
End With

It works at first, but once I click on any cell, all the text in D12 becomes
bold. Can you do something to make it work properly... It will be great if
you can help. If you can't, it's o.k. and I'm very thankful to you for trying
helping me before.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Concatenation 2 Texts

Best to clear it first

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Range("D12")
.Font.Bold = False
.Value = Range("A1").Value & "-" & Range("C1").Value
.Characters(1, Len(Range("A1").Value)) _
.Font.Bold = True
End With
End Sub

A small problem here is that it fires every time you select a cell, any c
ell. It would be better to be targeted at one particular cell. When do you
want the setup and formatting to happen?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hi_no_Tori" wrote in message
...
Once again, thank you very much for your help and your fast response Bob.

I
tried it and it works... But I still need some help. I need the

concatenation
to be in a fixed cell (e.g. D12), instead of the active cell... I tried

the
following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Range("D12")
.Value = Range("A1").Value & "-" & Range("C1").Value
.Characters(1, Len(Range("A1").Value)) _
.Font.Bold = True
End With

It works at first, but once I click on any cell, all the text in D12

becomes
bold. Can you do something to make it work properly... It will be great if
you can help. If you can't, it's o.k. and I'm very thankful to you for

trying
helping me before.



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Concatenation 2 Texts

Hi Bob...

Here is what I am trying to do exactly:

I have a text in cell A1, and another text in cell C1. I need to concatenate
them in cell D12. The font of the text from A1 should be normal, while the
text from cell C1 should be bold. I need to seperate between the two texts by
the sign " - ". I need this formatting to happen after I enter or modify the
text in cell A1 and cell C1.

I tried the code you have provided me with in your last post (the modified
one). Unlike before, it seems to work fine now. When I click on a cell now,
cell D12 formatting remains the same (i.e. Text from A1 normal, and Text from
C1 bold). That's basically what I need...

Thank you SO MUCH for your great help Bob. (^_^)
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Concatenation 2 Texts

This should also work, and is better as it fires ONLY when A1 or C1 is
changed

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1,C1"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Range("D12")
.Font.Bold = False
.Value = Range("A1").Value & "-" & Range("C1").Value
.Characters(1, Len(Range("A1").Value)) _
.Font.Bold = True
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

Just remove your code and replace with that, the whole procedure.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hi_no_Tori" wrote in message
...
Hi Bob...

Here is what I am trying to do exactly:

I have a text in cell A1, and another text in cell C1. I need to

concatenate
them in cell D12. The font of the text from A1 should be normal, while the
text from cell C1 should be bold. I need to seperate between the two texts

by
the sign " - ". I need this formatting to happen after I enter or modify

the
text in cell A1 and cell C1.

I tried the code you have provided me with in your last post (the modified
one). Unlike before, it seems to work fine now. When I click on a cell

now,
cell D12 formatting remains the same (i.e. Text from A1 normal, and Text

from
C1 bold). That's basically what I need...

Thank you SO MUCH for your great help Bob. (^_^)



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Concatenation 2 Texts

Hi Bob...

I've just tried the code, and It's working perfectly. Many, many thanks
indeed. Thanks to you Bob, my problem is now solved. (^_^)

"Bob Phillips" wrote:

This should also work, and is better as it fires ONLY when A1 or C1 is
changed

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1,C1"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Range("D12")
.Font.Bold = False
.Value = Range("A1").Value & "-" & Range("C1").Value
.Characters(1, Len(Range("A1").Value)) _
.Font.Bold = True
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

Just remove your code and replace with that, the whole procedure.

--
HTH

Bob Phillips


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
formula to apply concatenation to successive rows of data Devo Excel Worksheet Functions 2 July 24th 06 05:42 PM
How to change tick mark labels in z axis from values to texts? Flroa Charts and Charting in Excel 1 July 11th 06 06:28 PM
Concatenation Ken Excel Discussion (Misc queries) 1 April 12th 06 11:26 AM
Contatenate different color texts 1scant Excel Discussion (Misc queries) 3 February 24th 06 05:01 PM
Concatenation question ~C Excel Worksheet Functions 1 February 2nd 06 10:14 PM


All times are GMT +1. The time now is 05:56 PM.

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"