+ Reply to Thread
Results 1 to 3 of 3

runtime error "1004", no data selected to parse

  1. #1
    Registered User
    Join Date
    12-14-2008
    Location
    Singapore
    Posts
    4

    runtime error "1004", no data selected to parse

    hi all,

    have a runtime error "1004", no data selected to parse

    how do I fix this, probably something to do with the code, since if its an empty selection, there is no data to work with

    thanks vm

    here is the code:

    Sub Macro5()

    Dim ActSheet As Worksheet
    Dim SelRange As Range

    Set ActSheet = ActiveSheet
    Set SelRange = Selection

    SelRange.Select
    Selection.TextToColumns Destination:=SelRange, DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
    Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
    :="/", FieldInfo:=Array(1, 5), TrailingMinusNumbers:=True
    Selection.NumberFormat = "dd/mm/yy"

    End Sub

  2. #2
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: runtime error "1004", no data selected to parse

    I think your code isn't finding anything in your selected range with a "/" character in it. It is looking for this character to then split the data into columns so if in a cell you had
    01/02/10
    then you would end up with
    Column1___Column2___Column3
    ___01________02________10___

    If you are trying to manipulate dates, there are usually better ways. Have a look at the DAY(), MONTH() and YEAR() functions.

  3. #3
    Registered User
    Join Date
    12-14-2008
    Location
    Singapore
    Posts
    4

    Re: runtime error "1004", no data selected to parse

    thanks a lot. yeah, basically i had various dates listed in the 20091231 format, need to change it into 31 / 12 / 2009 (dd/mm/yy). used the convert text to column function as well as then formatting the cell as "custom" using dd/mm/yy.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1