+ Reply to Thread
Results 1 to 3 of 3

Macro. Copy range of cells (e,g, =A1:B9) and paste it into single cell.

  1. #1
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Macro. Copy range of cells (e,g, =A1:B9) and paste it into single cell.

    Hi all

    I'm bit struggling to find a solution to my problem. I would like to have a macro that would select cells between Column A and B - last row as per col A or col B whichever (data will always vertically reach same distance), minus the header text. I would like to keep it dynamic rather than hard coding the selected area. Then I would like it to paste it to a single cell that I have named previously as "InfoConc" (hypothetically lets say its like E1). I'm using this cell at later stage with another macro to compile an email and have this information included in a form of a text within the email body text.

    Information between the two columns could be separate by " - " to make it stick out bit more.

    Ex:
    Before macro:

    ----------- Col A ------------------------------------------------------------------------- Col B
    Row1--- Cause ----------------------------------------------------------------------- Hours
    Row2--- 20 - Operator Issue - Insufficient cover -------------------------- 24.0
    Row3--- 23 - Operator Issue - Meetings / Communications ----------- 3.0
    Row4--- 9 - Machine Issue - Guards / Doors -------------------------------- 1.5
    Row5--- 12 - Machine Issue - NC Control / Computer -------------------- 1.5
    Row6--- 15A - Machine Issue - Shuttle Pallet Clamping ----------------- 1.0
    Row7--- 1A - Machine Issue - Axis --------------------------------------------- 1.0
    Row8--- 37 - Tooling Issue - Shortage ----------------------------------------- 0.7


    After macro:

    Text in cel E1
    20 - Operator Issue - Insufficient cover - 24.0
    23 - Operator Issue - Meetings / Communications - 3.0
    9 - Machine Issue - Guards / Doors - 1.5
    12 - Machine Issue - NC Control / Computer - 1.5
    15A - Machine Issue - Shuttle Pallet Clamping - 1.0
    1A - Machine Issue - Axis - 1.0
    37 - Tooling Issue - Shortage - 0.7



    Example spreadsheet is attached (with sheets before and after).
    Any help is greatly appreciated.
    Cheers
    Attached Files Attached Files
    Last edited by rain4u; 11-26-2011 at 09:29 AM.

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro. Copy range of cells (e,g, =A1:B9) and paste it into single cell.

    for example
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Re: Macro. Copy range of cells (e,g, =A1:B9) and paste it into single cell.

    Thank you Nilem. It works like a charm.

+ 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