+ Reply to Thread
Results 1 to 3 of 3

Copying Cell Value

  1. #1
    Forum Contributor
    Join Date
    10-23-2003
    Posts
    141

    Copying Cell Value

    Hi,

    Does anyone have any suggestions for the following:

    On Workbook 1, Sheet One has approximately 50 rows of data. The data is in Column C and has about 10 different #'s (The other 40 cells in Column C contain duplicates).

    I would like a code that would look at column C in workbook one and copy each number that is not a duplicate to a different sheet in Workbook two (Cell B2).

    For example Column C Workbook One contains the following non-duplicate #'s
    10, 20, 30 (All other #'s in Column C are duplicates). I would like the Code to post the #'s in Workbook two as follows:

    Workbook Two(Cell B2):

    Sheet1 - 10
    Sheet2 - 20
    Sheet3 - 30

    Any help would be greatly appreciated.

    Thanks

  2. #2
    Tom Ogilvy
    Guest

    Re: Copying Cell Value

    Dim nodupes as New Collection
    Dim itm as Variant
    Dim rng as Range
    Dim i as Long
    Dim cell as Range
    with Workbooks("Workbook1.xls").Worksheets("Sheet One")
    set rng = .range(.cells(2,1),.cells(2,1).end(xldown))
    End with

    On error resume next
    for each cell in rng
    nodupes.add cell.Value, cell.Text
    next
    On Error goto 0

    set bk = Workbooks("Workbook2.xls")
    i = 1
    for each itm in nodupes
    bk.worksheets(i).Range("A1").Value = itm
    i = i + 1
    Next

    --
    Regards,
    Tom Oilvy


    "STEVEB" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi,
    >
    > Does anyone have any suggestions for the following:
    >
    > On Workbook 1, Sheet One has approximately 50 rows of data. The data
    > is in Column C and has about 10 different #'s (The other 40 cells in
    > Column C contain duplicates).
    >
    > I would like a code that would look at column C in workbook one and
    > copy each number that is not a duplicate to a different sheet in
    > Workbook two (Cell B2).
    >
    > For example Column C Workbook One contains the following non-duplicate
    > #'s
    > 10, 20, 30 (All other #'s in Column C are duplicates). I would like
    > the Code to post the #'s in Workbook two as follows:
    >
    > Workbook Two(Cell B2):
    >
    > Sheet1 - 10
    > Sheet2 - 20
    > Sheet3 - 30
    >
    > Any help would be greatly appreciated.
    >
    > Thanks
    >
    >
    > --
    > STEVEB
    > ------------------------------------------------------------------------
    > STEVEB's Profile:

    http://www.excelforum.com/member.php...fo&userid=1872
    > View this thread: http://www.excelforum.com/showthread...hreadid=484890
    >




  3. #3
    Forum Contributor
    Join Date
    10-23-2003
    Posts
    141
    Thanks Tom,

    Your example worked great! I really appreciate your help!!!!

+ 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