Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Format a string before write to a cell

Hi All
How to format a string before write to a cell ?
Trial Run Status , Remark and Reason for Stop Formatting are bold.

Also, how to underline ?

.....

'~~ Status ALL
GPD_Remark = ""

'~~ Trial Run Status
If Application.Selection.Range(GPD.STATUS_ADD
& ir).Value < "" Then
GPD_Remark = "Trial Run Status:" & Chr(10)
& Application.Selection.Range(GPD.STATUS_ADD & ir).Value & Chr(10)
End If
'~~ Remark
If Application.Selection.Range(GPD.Remark_Add
& ir).Value < "" Then
GPD_Remark = GPD_Remark & "Remark :" &
Chr(10) & Application.Selection.Range(GPD.Remark_Add & ir).Value &
Chr(10)
End If
'~~ Reason
If Application.Selection.Range(GPD.Reason_Add
& ir).Value < "" Then
GPD_Remark = GPD_Remark & "Reason for Stop
Formatting :" & Chr(10) & Application.Selection.Range(GPD.Reason_Add &
ir).Value
End If

If GPD_Remark < "" Then
.Range(MES.STATUS_ALL_ADD &
get_row(Rng_KEY.Address)).Value = GPD_Remark
End If
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Format a string before write to a cell

You have to format the cell where you want to place the comment.

With Range("A1").Font
.Bold = True
.Underline = True
End With

Regards,
Per

"moonhk" skrev i meddelelsen
...
Hi All
How to format a string before write to a cell ?
Trial Run Status , Remark and Reason for Stop Formatting are bold.

Also, how to underline ?

....

'~~ Status ALL
GPD_Remark = ""

'~~ Trial Run Status
If Application.Selection.Range(GPD.STATUS_ADD
& ir).Value < "" Then
GPD_Remark = "Trial Run Status:" & Chr(10)
& Application.Selection.Range(GPD.STATUS_ADD & ir).Value & Chr(10)
End If
'~~ Remark
If Application.Selection.Range(GPD.Remark_Add
& ir).Value < "" Then
GPD_Remark = GPD_Remark & "Remark :" &
Chr(10) & Application.Selection.Range(GPD.Remark_Add & ir).Value &
Chr(10)
End If
'~~ Reason
If Application.Selection.Range(GPD.Reason_Add
& ir).Value < "" Then
GPD_Remark = GPD_Remark & "Reason for Stop
Formatting :" & Chr(10) & Application.Selection.Range(GPD.Reason_Add &
ir).Value
End If

If GPD_Remark < "" Then
.Range(MES.STATUS_ALL_ADD &
get_row(Rng_KEY.Address)).Value = GPD_Remark
End If


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Format a string before write to a cell

On Feb 18, 5:10*pm, "Per Jessen" wrote:
You have to format the cell where you want to place the comment.

With Range("A1").Font
* * .Bold = True
* * .Underline = True
End With

Regards,
Per

"moonhk" skrev i ...

Hi All
How to format a string before write to a cell ?
Trial Run Status , Remark *and Reason for Stop Formatting are bold.


Also, how to underline ?


....


* * * * * * * * * * * *'~~ Status ALL
* * * * * * * * * * * *GPD_Remark = ""


* * * * * * * * * * * *'~~ Trial Run Status
* * * * * * * * * * * *If Application.Selection..Range(GPD.STATUS_ADD
& ir).Value < "" Then
* * * * * * * * * * * * * GPD_Remark = "Trial Run Status:" & Chr(10)
& Application.Selection.Range(GPD.STATUS_ADD & ir).Value & Chr(10)
* * * * * * * * * * * *End If
* * * * * * * * * * * *'~~ Remark
* * * * * * * * * * * *If Application.Selection..Range(GPD.Remark_Add
& ir).Value < "" Then
* * * * * * * * * * * * * GPD_Remark = GPD_Remark & "Remark :" &
Chr(10) & Application.Selection.Range(GPD.Remark_Add & ir).Value &
Chr(10)
* * * * * * * * * * * *End If
* * * * * * * * * * * *'~~ Reason
* * * * * * * * * * * *If Application.Selection..Range(GPD.Reason_Add
& ir).Value < "" Then
* * * * * * * * * * * * * GPD_Remark = GPD_Remark & "Reason for Stop
Formatting :" & Chr(10) & Application.Selection.Range(GPD.Reason_Add &
ir).Value
* * * * * * * * * * * *End If


* * * * * * * * * * * *If GPD_Remark < "" Then
* * * * * * * * * * * * *.Range(MES.STATUS_ALL_ADD &
get_row(Rng_KEY.Address)).Value = GPD_Remark
* * * * * * * * * * * *End If


Hi All
Thank for you suggestion.
Not all text are bold. Just part of text are bold.
e.g.

Title is bold
Line 2 is normal
This line is bold
This line is normal.
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
how to write 1234567890123456789 into a cell with number format Anila Excel Discussion (Misc queries) 3 February 13th 09 03:27 PM
00234566 write this format cell yeaqub Excel Discussion (Misc queries) 1 June 28th 08 10:51 AM
Search column for string and write to cell Blee Excel Programming 5 March 4th 08 02:17 PM
Write/Paste RTF or HTML string into one cell?? Bourgui Excel Programming 3 June 29th 07 02:08 PM
Can not write string to a cell wmauss[_3_] Excel Programming 2 June 19th 04 08:56 AM


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