LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Macro to Function

The below macro works perfect. It extracts the name from a text. How
can I change below macro into "Public Function" Please can any friend
can help

Sub GetNames()
For Each Cell In Range("A1:A4")
Text = Replace(Split(Cell, "\")(UBound(Split(Cell, "\"))), ".", " ")
Parts = Split(Text, " ", 3)
Parts(2) = ""
Cell.Offset(0, 1).Value = Trim(Join(Parts))
Next
End Sub
 
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
IF Macro / Function Kimmon Excel Worksheet Functions 8 December 9th 08 03:40 PM
Macro + IF Function? Gunti Excel Discussion (Misc queries) 1 December 9th 08 09:08 AM
If function in Macro Rick Excel Programming 11 August 9th 08 03:07 PM
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM


All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"