Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format selected character in a cell
I have an protected spreadsheet and I want to create a macro that when the
user select a portion of the text in a cell (not the cell), I apply a standard formating to this particular selection. How can I do that?? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format selected character in a cell
record a macro while doing it manually and you will see how to use
CHARACTERS. Then, just use what you need. Comment out or delete lines not needed. sub dochar With ActiveCell.Characters(Start:=4, Length:=2).Font .Name = "Arial" .FontStyle = "Bold" .Size = 11 ' .Strikethrough = False ' .Superscript = False ' .Subscript = False ' .OutlineFont = False ' .Shadow = False ' .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With end sub -- Don Guillett SalesAid Software "Biche" wrote in message ... I have an protected spreadsheet and I want to create a macro that when the user select a portion of the text in a cell (not the cell), I apply a standard formating to this particular selection. How can I do that?? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format selected character in a cell
Biche
Macros won't run when in Edit mode. You'll have to find some other method. Gord Dibben MS Excel MVP On Fri, 25 May 2007 13:27:00 -0700, Biche wrote: I have an protected spreadsheet and I want to create a macro that when the user select a portion of the text in a cell (not the cell), I apply a standard formating to this particular selection. How can I do that?? Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format selected character in a cell
This is what I'm trying to find...
"Gord Dibben" wrote: Biche Macros won't run when in Edit mode. You'll have to find some other method. Gord Dibben MS Excel MVP On Fri, 25 May 2007 13:27:00 -0700, Biche wrote: I have an protected spreadsheet and I want to create a macro that when the user select a portion of the text in a cell (not the cell), I apply a standard formating to this particular selection. How can I do that?? Thanks |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format selected character in a cell
Something like this for example?
Sub CellFont() Dim ostart As Integer Dim onum As Integer ostart = InputBox("enter character start number") onum = InputBox("enter numbers of characters to format") ActiveSheet.Unprotect Password:="justme" With ActiveCell.Characters(Start:=ostart, Length:=onum).Font .ColorIndex = 3 .Bold = True .Underline = True .Size = 14 End With ActiveSheet.Protect Password:="justme" End Sub Gord On Sat, 26 May 2007 05:45:02 -0700, Biche wrote: This is what I'm trying to find... "Gord Dibben" wrote: Biche Macros won't run when in Edit mode. You'll have to find some other method. Gord Dibben MS Excel MVP On Fri, 25 May 2007 13:27:00 -0700, Biche wrote: I have an protected spreadsheet and I want to create a macro that when the user select a portion of the text in a cell (not the cell), I apply a standard formating to this particular selection. How can I do that?? Thanks |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format selected character in a cell
I think I will be using InputBox and/or form do that, since I can't do it
more easily. Thanks "Gord Dibben" wrote: Something like this for example? Sub CellFont() Dim ostart As Integer Dim onum As Integer ostart = InputBox("enter character start number") onum = InputBox("enter numbers of characters to format") ActiveSheet.Unprotect Password:="justme" With ActiveCell.Characters(Start:=ostart, Length:=onum).Font .ColorIndex = 3 .Bold = True .Underline = True .Size = 14 End With ActiveSheet.Protect Password:="justme" End Sub Gord On Sat, 26 May 2007 05:45:02 -0700, Biche wrote: This is what I'm trying to find... "Gord Dibben" wrote: Biche Macros won't run when in Edit mode. You'll have to find some other method. Gord Dibben MS Excel MVP On Fri, 25 May 2007 13:27:00 -0700, Biche wrote: I have an protected spreadsheet and I want to create a macro that when the user select a portion of the text in a cell (not the cell), I apply a standard formating to this particular selection. How can I do that?? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
replace a single character WITH FORMAT in a cell | Excel Worksheet Functions | |||
Format changed when the cell selected | Excel Worksheet Functions | |||
Find cells with a specific character in them and conditionally format cell | Excel Programming | |||
Format cell to accept only specific character-reject others | Excel Discussion (Misc queries) | |||
Copy partial cell character format(s) from one cell to another - an example | Excel Programming |