Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Moving a Variant to Array

I have a ComboBox with a following data (code and name):
12345acb namenamenamenam
123c namenamenamename

and then I need to move only first data (code) to a variant in order to use
in Vlookup. Is an option to move each characters and ending when find the
first blank...? How I can make this?
Thanks for your help.
Ivan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Moving a Variant to Array

dim myStr as string
dim SpacePos as long
myStr = "123c namenamenamename"

spacepos = instr(1,mystr&" "," ")

msgbox left(mystr,spacepos-1)

might be a way to go about it.


Ivan wrote:

I have a ComboBox with a following data (code and name):
12345acb namenamenamenam
123c namenamenamename

and then I need to move only first data (code) to a variant in order to use
in Vlookup. Is an option to move each characters and ending when find the
first blank...? How I can make this?
Thanks for your help.
Ivan


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Moving a Variant to Array

Dave, thanks. Only a comment, because I need to change following sentence:
spacepos = instr(1, mystr, " ", 1)
With this change my sentence is working ok.
Best regards,
Iván


"Dave Peterson" wrote:

dim myStr as string
dim SpacePos as long
myStr = "123c namenamenamename"

spacepos = instr(1,mystr&" "," ")

msgbox left(mystr,spacepos-1)

might be a way to go about it.


Ivan wrote:

I have a ComboBox with a following data (code and name):
12345acb namenamenamenam
123c namenamenamename

and then I need to move only first data (code) to a variant in order to use
in Vlookup. Is an option to move each characters and ending when find the
first blank...? How I can make this?
Thanks for your help.
Ivan


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Moving a Variant to Array

Oops.

Thanks for the correction.

Ivan wrote:

Dave, thanks. Only a comment, because I need to change following sentence:
spacepos = instr(1, mystr, " ", 1)
With this change my sentence is working ok.
Best regards,
Iván

"Dave Peterson" wrote:

dim myStr as string
dim SpacePos as long
myStr = "123c namenamenamename"

spacepos = instr(1,mystr&" "," ")

msgbox left(mystr,spacepos-1)

might be a way to go about it.


Ivan wrote:

I have a ComboBox with a following data (code and name):
12345acb namenamenamenam
123c namenamenamename

and then I need to move only first data (code) to a variant in order to use
in Vlookup. Is an option to move each characters and ending when find the
first blank...? How I can make this?
Thanks for your help.
Ivan


--

Dave Peterson


--

Dave Peterson
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
ReDim Object array as parameter of Variant array Peter T Excel Programming 4 May 10th 05 02:11 PM
Coercing a variant into an array Alex T Excel Programming 1 November 18th 04 09:54 PM
Variant Array Steph[_3_] Excel Programming 1 June 2nd 04 01:29 AM
Asign Array Variant to Column William C. Smith Excel Programming 3 December 27th 03 04:20 AM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM


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