+ Reply to Thread
Results 1 to 10 of 10

Need MACRO to copy the text in the cell left of first selected cells (a column), paste all

  1. #1
    Registered User
    Join Date
    08-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Need MACRO to copy the text in the cell left of first selected cells (a column), paste all

    Hi Experts,

    I am trying to automate my cut and paste operation for a document in excel format.

    I need a MACRO that will copy the text in the cell to the left of first selected cells (a column), paste this text value into all the selected cells.

    So, what i am trying to do is this ...

    a. Select a column of cells, eg: B1 to B4
    b. Press some shortcut to trigger the MACRO
    c. Macro will copy the text in cell A1 (to the left of B1), paste this text value into all the selected cells in step a, ie: from cells B1 to B4.

    That's it for now.

    Thank you.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Need MACRO to copy the text in the cell left of first selected cells (a column), paste

    Hi,

    Insert this code into a module, then use the macros menu on the developer tab on the Excel 2007 ribbon to assign a shortcut key to trigger the macro.
    Please Login or Register  to view this content.
    Hope this helps

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need MACRO to copy the text in the cell left of first selected cells (a column), paste

    Hi,

    Put this Procedure in a Module and attach it to any button or shape object, (right click the object and choose 'Assign Macro), or assign a shortcut key to it. On the Ribbon: Developer...Macros...select the macro name..choose Options and add the key of your choise

    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 08-16-2013 at 04:48 AM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    08-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Need MACRO to copy the text in the cell left of first selected cells (a column), paste

    Thank you ajryan88, it worked.
    Last edited by joobeng; 08-16-2013 at 05:53 AM.

  5. #5
    Registered User
    Join Date
    08-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Need MACRO to copy the text in the cell left of first selected cells (a column), paste

    Thank you Richard, this worked too.

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Put this Procedure in a Module and attach it to any button or shape object, (right click the object and choose 'Assign Macro), or assign a shortcut key to it. On the Ribbon: Developer...Macros...select the macro name..choose Options and add the key of your choise

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Need MACRO to copy the text in the cell left of first selected cells (a column), paste

    You're welcome

    Please don't forget to mark this thread as solved and click on the star next to my post and Richard's post to say thanks.

    Have a great day

  7. #7
    Registered User
    Join Date
    08-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Need MACRO to copy the text in the cell left of first selected cells (a column), paste

    I was trying to do both things you mentioned but could not find the buttons to do that ! May be it's because it's Friday.

    Pls advise, or do i need to post or that? LOL.

    Quote Originally Posted by ajryan88 View Post
    You're welcome

    Please don't forget to mark this thread as solved and click on the star next to my post and Richard's post to say thanks.

    Have a great day

  8. #8
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Need MACRO to copy the text in the cell left of first selected cells (a column), paste

    Lol.

    The star is just beneath each person's post, where it says "Add Reputation", and to mark a thread as solved go to the first post in the thread and click Thread Tools --> Mark Thread as Solved.

  9. #9
    Registered User
    Join Date
    08-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Need MACRO to copy the text in the cell left of first selected cells (a column), paste

    Done. Thanks again.

    Quote Originally Posted by ajryan88 View Post
    Lol.

    The star is just beneath each person's post, where it says "Add Reputation", and to mark a thread as solved go to the first post in the thread and click Thread Tools --> Mark Thread as Solved.

  10. #10
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Need MACRO to copy the text in the cell left of first selected cells (a column), paste

    Thanks.

    You're welcome

+ 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. VBA to copy selected cells down to empty cell and paste
    By rioutousgnome in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-28-2013, 01:55 PM
  2. [SOLVED] Macro: always copy/paste text from cell "I" (on the same row the was cell selected)
    By rampal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 03:43 AM
  3. [SOLVED] copy/paste macro to selected blank cells
    By fumc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-04-2012, 10:08 PM
  4. Replies: 10
    Last Post: 02-02-2012, 07:03 PM
  5. macro to copy and paste into a selected cell?
    By jpisconti in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2009, 07:03 PM

Tags for this Thread

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