View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
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