View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
JMay JMay is offline
external usenet poster
 
Posts: 468
Default How to FIX Recorded Macro

AKphidelt -- Thanks for your comment. I went back and played with it a bit
more and came up with this (and added to my personal.xls file) - which is
what I wanted in the first place.
Thanks for the encouragement.

Sub NumToText()
' Macro recorded 5/22/2007 by Jim May
'
With ActiveCell
TFontName = .Font.Name
TFontSize = .Font.Size
End With
Selection.NumberFormat = "@"
With ActiveCell.Characters(Start:=1, Length:=3).Font
.Name = TFontName
.FontStyle = "Regular"
.Size = TFontSize
End With
End Sub



"AKphidelt" wrote:

What's not working with it?... works fine for me.

"JMay" wrote:

I want to create a macro that will convert a number to Text format
so that it can be read by another formula where the cell needs to be text.
Below is the result of turning on the recorder and doing as follows (with my
cell that needs fixing selected before):

Format, Cells, Text, OK
F2 pressed (To bring up in edit mode) + enter

But it doesn't seem to be working...
CAn someone assist?

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 5/22/2007 by Jim May
'

'
Selection.NumberFormat = "@"
' ActiveCell.FormulaR1C1 = "879"
With ActiveCell.Characters(Start:=1, Length:=3).Font
.Name = "Verdana"
.FontStyle = "Regular"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
' Range("L1149").Select
End Sub