+ Reply to Thread
Results 1 to 4 of 4

Copy column data

  1. #1
    Registered User
    Join Date
    01-10-2006
    Posts
    17

    Question Copy column data

    Hi,

    I want to write a macro by whic I will mention the number of characters in one column then it should select only those number of characters for the entire row.

    eg. if I mention number of characters as 6 for 'column a', (I will mention this in a seperate column. Macro should read this value from that column) then it should copy only 6 characters of EACH cell in 'column a'

    Do we anything kind of format etc for this thing?

    Thanks,
    Sylvia

  2. #2
    Tim Williams
    Guest

    Re: Copy column data

    Where should the values be copied to?

    Tim


    "Sylvia" <Sylvia.22hjqz_1138688101.8995@excelforum-nospam.com> wrote in
    message news:Sylvia.22hjqz_1138688101.8995@excelforum-nospam.com...
    >
    > Hi,
    >
    > I want to write a macro by whic I will mention the number of characters
    > in one column then it should select only those number of characters for
    > the entire row.
    >
    > eg. if I mention number of characters as 6 for 'column a', (I will
    > mention this in a seperate column. Macro should read this value from
    > that column) then it should copy only 6 characters of EACH cell in
    > 'column a'
    >
    > Do we anything kind of format etc for this thing?
    >
    > Thanks,
    > Sylvia
    >
    >
    > --
    > Sylvia
    > ------------------------------------------------------------------------
    > Sylvia's Profile:
    > http://www.excelforum.com/member.php...o&userid=30300
    > View this thread: http://www.excelforum.com/showthread...hreadid=506668
    >




  3. #3
    Registered User
    Join Date
    01-10-2006
    Posts
    17
    In the new worksheet.

  4. #4
    Tim Williams
    Guest

    Re: Copy column data

    Sub Tester()
    Dim s As Worksheet
    Dim s2 As Worksheet
    Dim r As Long, x

    Set s = ActiveSheet
    Set s2 = ThisWorkbook.Sheets("Sheet2")

    r = 1
    x = Application.InputBox("Enter number of characters", _
    , , , , , , 1)

    Do While s.Cells(r, 1).Value <> ""
    s2.Cells(r, 1).Value = Left(s.Cells(r, 1).Value, x)
    r = r + 1
    Loop
    End Sub

    Tim



    "Sylvia" <Sylvia.22hkfy_1138689001.1798@excelforum-nospam.com> wrote in
    message news:Sylvia.22hkfy_1138689001.1798@excelforum-nospam.com...
    >
    > In the new worksheet.
    >
    >
    > --
    > Sylvia
    > ------------------------------------------------------------------------
    > Sylvia's Profile:
    > http://www.excelforum.com/member.php...o&userid=30300
    > View this thread: http://www.excelforum.com/showthread...hreadid=506668
    >




+ 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