Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
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
replace a single character WITH FORMAT in a cell ela Excel Worksheet Functions 9 February 24th 10 03:30 AM
Format changed when the cell selected Freshman Excel Worksheet Functions 5 May 26th 08 10:34 AM
Find cells with a specific character in them and conditionally format cell RITCHI Excel Programming 2 February 11th 07 01:20 PM
Format cell to accept only specific character-reject others aetzkin Excel Discussion (Misc queries) 2 December 27th 05 05:03 PM
Copy partial cell character format(s) from one cell to another - an example [email protected] Excel Programming 0 May 5th 05 08:23 PM


All times are GMT +1. The time now is 06:11 AM.

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"