+ Reply to Thread
Results 1 to 7 of 7

Copy each manually selected cell to new column but same row

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Copy each manually selected cell to new column but same row

    Hi everyone,

    I have the following code:

    Please Login or Register  to view this content.
    Selection.offset(0,0) are manually selected cells in column B

    When I select more than 1 cell in column B and run the macro, the concatenated results has everything right EXCEPT selection.offset(0,4) only shows the first cell selected in the group (assigned by selection.offset(0,0). So instead of the results showing like this:

    121
    122
    123

    It shows

    121
    121
    121

    How can I adjust the code so that the contents of every sell selected will appear in the corresponding paste column?

    Thanks!!

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Copy each manually selected cell to new column but same row

    can you upload a sample file? a dummy, sanitized file with some examples?
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Copy each manually selected cell to new column but same row

    In the absence of a sample, I have not tested this, but try:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Copy each manually selected cell to new column but same row

    why would anyone do that:
    Please Login or Register  to view this content.
    ???

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Copy each manually selected cell to new column but same row

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Copy each manually selected cell to new column but same row

    bulina,

    I presume although not very tidy, that the 5th column just temporarily stores the data from B30 and B29..., it would be simpler to do the routine in one line:

    Please Login or Register  to view this content.
    However, I was trying to solve the OP's issue without changing their approach to the code.

  7. #7
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Copy each manually selected cell to new column but same row

    Thanks very much for your help, everyone. I went with Alpha's suggestion.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 9
    Last Post: 11-20-2015, 04:20 AM
  2. Want to change the dates in selected cells manually using a MACRO
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2013, 03:22 AM
  3. [SOLVED] Need MACRO to copy the text in the cell left of first selected cells (a column), paste all
    By joobeng in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-16-2013, 06:42 AM
  4. Macro to copy a value from a table (manually pick) and paste to active cell.
    By cyroselane in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 03:58 AM
  5. [SOLVED] Use current cell and column as a range without entering it manually
    By dt_org in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-06-2013, 03:39 AM
  6. Move contents of manually selected cell
    By nebb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-22-2009, 11:20 PM
  7. Copy selected cell in column and fill in blanks
    By Bluestar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2005, 10:28 AM

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