#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Repeat a Macro

Hello-

I am a newbie here and at a very basic level of visual basic. What I
am trying to accomplish is to remove the formatting of a phone number
and I am trying to remove the first bracket around the area code of a
phone number. What I want to do is create a macro that would repeat
the following function:

Range("Y2").Select
ActiveCell.FormulaR1C1 = "9543/814-254666"
With ActiveCell.Characters(Start:=1, Length:=15)
End With

However, for the active cell the data will be different for each
active cell and not what is listed above ("9543/814-25466").

Can anyone help on 1) how to create the macro so it repeats the
functionality and 2) how to state that the active cell could have any
data in it but would need?

Thank you.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,089
Default Repeat a Macro

Might be easier if you told us what the data looks like before the macro is
run and how you want it to look afterwards ... content and format.

See if this helps:

With Selection
' remove first character
.Value = Right(.Value, Len(.Value) - 1)
' remove format
.Interior.ColorIndex = xlNone
End With

Regards

Trevor


Regards
"Victoria" wrote in message
oups.com...
Hello-

I am a newbie here and at a very basic level of visual basic. What I
am trying to accomplish is to remove the formatting of a phone number
and I am trying to remove the first bracket around the area code of a
phone number. What I want to do is create a macro that would repeat
the following function:

Range("Y2").Select
ActiveCell.FormulaR1C1 = "9543/814-254666"
With ActiveCell.Characters(Start:=1, Length:=15)
End With

However, for the active cell the data will be different for each
active cell and not what is listed above ("9543/814-25466").

Can anyone help on 1) how to create the macro so it repeats the
functionality and 2) how to state that the active cell could have any
data in it but would need?

Thank you.



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
Get Macro to Repeat on Each Worksheet rgatto Excel Discussion (Misc queries) 2 July 3rd 07 12:48 AM
How to get a macro to repeat \\sh Excel Discussion (Misc queries) 2 November 6th 06 05:04 PM
Repeat Macro tvkodde26 Excel Worksheet Functions 5 October 19th 05 07:37 PM
Getting a macro to repeat Hru48 Excel Discussion (Misc queries) 2 August 18th 05 07:27 PM
Macro to repeat formulas in next row katiekay Excel Discussion (Misc queries) 5 February 10th 05 08:28 PM


All times are GMT +1. The time now is 06:28 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"