Search Windows and Linux Networking

Thursday, December 8, 2011

Using Split Function in VBScript

Using Split Function in VBScript to get needed value

'Using Split Function with delimited with ://

Dim strOutPut ,i, strMngrDn
Dim strValue

strOutPut = "LDAP://cn=Sandeep Kapadane,OU=Pune,DC=Domainname,DC=com"
strValue = Split(strOutPut,"://")

For i = 0 to Ubound(strValue)
    strmngrDn=strValue(1)
Next
Msgbox strMngrDN


OUT PUT OF strMngrDN will be:-
cn=Sandeep Kapadane,OU=Pune,DC=Domainname,DC=com



Tuesday, December 6, 2011

Excel Function to split text from one cell to other two cells

Excel Function (formula) to split text from one cell to other two Cells

Suppose you have excel file with User name in same cell like shown in following screen shot.


and If you want to split cell in other column cell for First name and Last Name.Then write the function MID

=MID(A2,1,SEARCH(" ",A2)) 

To get First Name of (Sandeep Kapadane) result will be Sandeep.

And to get Last name in other cell then write the function as:-

=MID(A2,SEARCH(" ",A2)+1,20)

To get Last Name of (Sandeep Kapadane) result will be Kapadane

Now drag the formula to apply to all you result will be look like