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: 38
Default How do I capture the last character in a string inside a macro?


Thanks in advance.

I've written a macro that will take data from my worksheet and compile
a report that I have to write often at work. The customer's name is
mentioned in the report several times, once in the possessive. I can
make the macro place a " 's " at the proper time, but I can't make it
not place it there when the customer's name ends in " s ". I need to
call the last character in the name string, called "LastName" and
determine if it's an " s " or not. Can someone please teach me how to
do that?

Also, I will end up sharing this spreadsheet with co-workers and I
don't want them to have access to the code. Not because I don't want
to share; I don't want them to wreck it. The spreadsheet will sit in a
directory on our computers that is common to all workers. I could just
save a copy and over write occasionally, but if there is a way to lock
the code, it would be easier for me.

Thanks guys and girls. I appreciate all the help. The thread on the
"Randomize Timer" was phenomenal. It helped me a great deal. When I
ran my dice program using Randomize Timer at the beginning of the
macro, and just using "RND" to "roll the dice", it lost the correct
amount of money within normal parameters.

JasonK


 
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
Excel-Match 1st text character in a string to a known character? bushlite Excel Worksheet Functions 2 January 15th 07 06:36 PM
Wildcard character inside sumproduct andy62 Excel Worksheet Functions 4 November 1st 06 09:46 AM
Function to return Character Position of Xth character within a string Andibevan[_2_] Excel Programming 4 June 9th 05 03:24 PM
Need macro to insert text string while inside cell (formula) BrianB Excel Discussion (Misc queries) 0 May 31st 05 03:18 PM
how to capture enter key inside a cell helpwithXL Excel Programming 3 April 1st 05 03:54 PM


All times are GMT +1. The time now is 04:34 PM.

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"