Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
My cell contains several strings, a carriage return, and the more strings.
Iam trying to italicize the strings that follow the carriage return. This is the code I'm using. Somehow Im usingthe wrong syntax for search butcan figure it out. Help please or pointers to functions I'm misusing. Thanks c.offset(RowIndex, 2).Characters(Start:=10, Length:=(Search(Chr(10), ActiveCell))).Font.FontStyle = "italic" |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have entered the length and start as separate lines of code to be as clear
as possible: Sub Macro2() Dim l As Long Dim r As Range Dim s As String Dim retrun As String retrun = Chr(10) Set r = Selection l = Len(r) k = InStr(r.Value, retrun) + 1 r.Characters(Start:=k, Length:=l - k + 1).Font.FontStyle = "Italic" End Sub -- Gary's Student "Brian Bonner" wrote: My cell contains several strings, a carriage return, and the more strings. Iam trying to italicize the strings that follow the carriage return. This is the code I'm using. Somehow Im usingthe wrong syntax for search butcan figure it out. Help please or pointers to functions I'm misusing. Thanks c.offset(RowIndex, 2).Characters(Start:=10, Length:=(Search(Chr(10), ActiveCell))).Font.FontStyle = "italic" |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks Gary"s Student. Did a little tweaking and it works fine.
"Gary''s Student" wrote: I have entered the length and start as separate lines of code to be as clear as possible: Sub Macro2() Dim l As Long Dim r As Range Dim s As String Dim retrun As String retrun = Chr(10) Set r = Selection l = Len(r) k = InStr(r.Value, retrun) + 1 r.Characters(Start:=k, Length:=l - k + 1).Font.FontStyle = "Italic" End Sub -- Gary's Student "Brian Bonner" wrote: My cell contains several strings, a carriage return, and the more strings. Iam trying to italicize the strings that follow the carriage return. This is the code I'm using. Somehow Im usingthe wrong syntax for search butcan figure it out. Help please or pointers to functions I'm misusing. Thanks c.offset(RowIndex, 2).Characters(Start:=10, Length:=(Search(Chr(10), ActiveCell))).Font.FontStyle = "italic" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I search a cell for a value and extract part of content? | Excel Discussion (Misc queries) | |||
How do I delete part of a text string in every cell it appears in | Excel Discussion (Misc queries) | |||
cell color index comparison | New Users to Excel | |||
=IF logical test to search only part of a cell | Excel Worksheet Functions | |||
How do I test a cell for part of text | Excel Worksheet Functions |