ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Record Macro Relative does not work? (https://www.excelbanter.com/excel-discussion-misc-queries/1785-record-macro-relative-does-not-work.html)

lbbss

Record Macro Relative does not work?
 
Can someone help me with this macro. I want to go to any cell of my
choice and press f2 to edit, then go to the fifth character of that cell,
then select the next 6 characters and change them to a smaller font size
(8), then "enter". I tried to make this macro using the record macro
function, but it did not work how I want it to. It ends up pasting the
contents of the cell which I used to record the macro initially. Can
this kind of macro be done?



Gord Dibben

lbbss

Sub Change_Font()

With ActiveCell.Characters(Start:=5, Length:=6).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 8
End With

End Sub

Gord Dibben Excel MVP

On Fri, 10 Dec 2004 12:09:48 -0500, "lbbss" wrote:

Can someone help me with this macro. I want to go to any cell of my
choice and press f2 to edit, then go to the fifth character of that cell,
then select the next 6 characters and change them to a smaller font size
(8), then "enter". I tried to make this macro using the record macro
function, but it did not work how I want it to. It ends up pasting the
contents of the cell which I used to record the macro initially. Can
this kind of macro be done?




All times are GMT +1. The time now is 03:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com