Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Slect left and right part of text

Hi All,

I have the following format text in a ComboBox of a UserForm.

1:1, 1:2..... 2:1, 2:2... and upt 110:200.

How i can select the left part before ":" and right part after ":" ?

since the number of charecters in the combobox is not the same (1:1
gives 3 while 110:200 gives 7) .

My objective is to select a file from my directory wher files are named
001001 through 110200, so that if cobobox value is 1:1 then i have to
select file 001001 and if combobox value is 110:200 then file 110200.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Slect left and right part of text

Dim v As Variant
v = Split(Cells(1, "A"), ":")

v(0) contains LH value, v(1) contains RH value

"Soniya" wrote:

Hi All,

I have the following format text in a ComboBox of a UserForm.

1:1, 1:2..... 2:1, 2:2... and upt 110:200.

How i can select the left part before ":" and right part after ":" ?

since the number of charecters in the combobox is not the same (1:1
gives 3 while 110:200 gives 7) .

My objective is to select a file from my directory wher files are named
001001 through 110200, so that if cobobox value is 1:1 then i have to
select file 001001 and if combobox value is 110:200 then file 110200.

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Slect left and right part of text

I am not much with combo box but if the entries are in cells the following
will be relevant and you can modify

if the entry is in a cell because of colon(:) the format will be
automatially time. if you introduce a single apostrophe (') first (i.e '1:1)
it wil be text unlesss the cell is already formatted as text.

in that case to get left of colon, use this formula

=LEFT(E12,SEARCH(":",E12)-1)

to get the numbers to the rights of colon use this formula

=MID(E12,SEARCH(":",E12)+1,LEN(E12)-SEARCH(":",E12))

E12 is the cell where the entry is.
modify to suit you

"Soniya" wrote in message
oups.com...
Hi All,

I have the following format text in a ComboBox of a UserForm.

1:1, 1:2..... 2:1, 2:2... and upt 110:200.

How i can select the left part before ":" and right part after ":" ?

since the number of charecters in the combobox is not the same (1:1
gives 3 while 110:200 gives 7) .

My objective is to select a file from my directory wher files are named
001001 through 110200, so that if cobobox value is 1:1 then i have to
select file 001001 and if combobox value is 110:200 then file 110200.

Thanks



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
Returning left part of cell before a character Alan Excel Discussion (Misc queries) 6 April 4th 23 02:26 PM
how do I ungrey icons so I can slect them fizy Excel Discussion (Misc queries) 1 December 19th 08 10:21 PM
Third left part of the screen is frozen [email protected] Excel Discussion (Misc queries) 0 March 13th 07 01:14 PM
Chart - slect month by Combo box deejayh Charts and Charting in Excel 1 June 15th 06 02:27 AM
return left most part of cell Pat Excel Worksheet Functions 5 September 9th 05 04:34 PM


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