From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On 
Behalf Of Lalit Mohan Pandey
Sent: Thursday, August 29, 2013 2:10 PM
To: excel-macros@googlegroups.com
Cc: vatspoojav...@gmail.com
Subject: $$Excel-Macros$$ Re: Fw: Query on Text to Columns function

Try this

Option Explicit

Sub SplitValues()

    Dim lngLoop             As Long
    Dim vararrRawData()     As Variant
    Dim vararrSplitData     As Variant

    'Const variable change accordingly as per your requirement
    Const strDataRangeToSplit       As String = "C1:C65536"
    Const strDataShtName            As String = "Sheet1"
    Const strDataOutputShtName      As String = "Sheet1"
    Const strDataOutputCell         As String = "J1"

    With ThisWorkbook
        With .Worksheets(strDataShtName)
            vararrRawData = .Range(strDataRangeToSplit).Value
        End With
        With .Worksheets(strDataOutputShtName)
            For lngLoop = LBound(vararrRawData) To UBound(vararrRawData)
                .Range(strDataOutputCell).Offset(lngLoop - 1, 0).Value = 
vararrRawData(lngLoop, 1)
                vararrSplitData = Split(Replace(vararrRawData(lngLoop, 1), ".", 
".'"), ".")
                If UBound(vararrSplitData) = 0 Then
                    vararrSplitData(0) = vbNullString
                End If
                .Range(strDataOutputCell).Offset(lngLoop - 1, 1).Resize(, 
UBound(vararrSplitData) + 1).Value = vararrSplitData
            Next lngLoop
        End With
    End With

    lngLoop = Empty
    Erase vararrRawData
    vararrSplitData = Empty

End Sub


On Thursday, 29 August 2013 13:32:17 UTC+5:30, Pooja wrote:
Hi All,

Please advice on the below query.

Regards
Pooja Sharma
Sent from BlackBerry(r) on Airtel
________________________________
From: Pooja Sharma <pooja....@dc.ibm.com<javascript:>>
Date: Thu, 29 Aug 2013 13:19:08 +0530
To: <vatspo...@gmail.com<javascript:>>
Subject: Query on Text to Columns function

Hi All,

I am seeking for your support on one of my file (attached), wherein I have to 
separate the values in different columns, the separator (Delimitor) value is 
the "." sign.

I was trying to do this with the function text to columns, but it removes the 
zero value and I need these 0 values too.

Please advice.
--
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It's 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
---
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.
This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient, you are not authorized 
to read, print, retain, copy, disseminate, distribute, or use this message or 
any part thereof. If you receive this message in error, please notify the 
sender immediately and delete all copies of this message.

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to