Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Grab Last Name data within Title and Name


I am working on a roster list and the problem I am coming acroos i
this.

Here's my setup. I have a main page that I use t
access\view\manipulate all information. I have an info page tha
contains all the data I need depending on which situation I'm workin
on.

On the main page I can mark which records I want to view data on.

It searches the info page for the records I have marked

It returns the info I want.

Main Page:

title and Last Name Mark(X)
Mr. Johnson x
Mr. Smith x
Mr. Anderson
FCC Yeti x
ACC Fowler

Info Page:
Laste Name First Name Middle Name Title
.......................


My problem is when running the Macro, I cannot figure out how I can ge
VB to take out the title away from the last name (which I need on th
main page for other items). What I was thinking was

Name = ActiveCell.Offset(0, -1).Value
Sheets("info").Select
Range("A1").Select
Do
ActiveCell.Offset(1, 0).Select
Loop Until ActiveCell.Value = CONCATENATE(RC3, " ", Name)

This way it searches for the name along with the title until it gets
match but I keep on getting "Sub or Function not defined" Any ideas o
how I can go about this? (Note: RC3 is where the title is located at).


Thanks,


J. Vamo

--
vamos
-----------------------------------------------------------------------
vamosj's Profile: http://www.excelforum.com/member.php...nfo&userid=869
View this thread: http://www.excelforum.com/showthread.php?threadid=27348

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Grab Last Name data within Title and Name

the reason you're getting an error is because you're trying to use
CONCATENATE(), which is an Excel function. You could either wrap this call
in Evaluate(), or use VBA's concatenation operator: &

Or you could just strip off the title (if you can assume that the title and
last name will only be comprised of two words which are separated by a
space) by: Right(str, len(str) - instr(str, " ")) Then use the VBA
find() function which will likely be faster than any homemade search.


"vamosj" wrote in message
...

I am working on a roster list and the problem I am coming acroos is
this.

Here's my setup. I have a main page that I use to
access\view\manipulate all information. I have an info page that
contains all the data I need depending on which situation I'm working
on.

On the main page I can mark which records I want to view data on.

It searches the info page for the records I have marked

It returns the info I want.

Main Page:

title and Last Name Mark(X)
Mr. Johnson x
Mr. Smith x
Mr. Anderson
FCC Yeti x
ACC Fowler

Info Page:
Laste Name First Name Middle Name Title
......................


My problem is when running the Macro, I cannot figure out how I can get
VB to take out the title away from the last name (which I need on the
main page for other items). What I was thinking was

Name = ActiveCell.Offset(0, -1).Value
Sheets("info").Select
Range("A1").Select
Do
ActiveCell.Offset(1, 0).Select
Loop Until ActiveCell.Value = CONCATENATE(RC3, " ", Name)

This way it searches for the name along with the title until it gets a
match but I keep on getting "Sub or Function not defined" Any ideas on
how I can go about this? (Note: RC3 is where the title is located at).


Thanks,


J. Vamos


--
vamosj
------------------------------------------------------------------------
vamosj's Profile:
http://www.excelforum.com/member.php...fo&userid=8695
View this thread: http://www.excelforum.com/showthread...hreadid=273481



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
IF function to grab data mike Excel Worksheet Functions 1 February 25th 09 02:22 AM
Numeric reference of column. Data Grab ? bigexcelfan Excel Discussion (Misc queries) 3 January 4th 06 11:26 PM
Grab matching data and populate? Fletcher Excel Worksheet Functions 1 December 22nd 04 03:26 PM
Software of scripting to grab data from MS word file and fill in Excel fields? Joe Blo Excel Programming 2 October 6th 04 09:54 PM
How can I grab data from a SQL Server stored procedure Sam Excel Programming 3 December 4th 03 03:38 PM


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