+ Reply to Thread
Results 1 to 8 of 8

VBA Macro to Copy and Paste in a table

  1. #1
    Registered User
    Join Date
    07-20-2018
    Location
    Luxembourg
    MS-Off Ver
    2016
    Posts
    6

    VBA Macro to Copy and Paste in a table

    I have one table... and i want to include a macro when click the "SAVE" buttom to do the following:

    • Select the text in (E8:S8);
    • Cut the VALUES only;
    • Paste it in (E10:S10);

    As E8:S8 is some kind of input line, next time that want to save the information, the macro shall past the input in the first available line, which it is (E11:S11) and so on...

    Can some you guys help me out?
    Last edited by Ransick; 07-20-2018 at 08:01 AM.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,802

    Re: VBA Macro : HELPPPPPP!!!

    Hello
    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    46,875

    Re: VBA Macro : HELPPPPPP!!!

    Welcome to the forum! Please take a moment to re-read forum rule #1 and then amend your thread title to something that better explains your problem. Changing your thread title is not optional, which means you must change it. Thanks!

    • Use concise, accurate thread titles.
    • Your post title should describe your problem, not your anticipated solution.
    • Use terms appropriate to a Google search - poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice tell us nothing.
    • Responding to a request to change your thread title by doing so is mandatory.

    To change a title go to your first post, click EDIT then Go Advanced and change your title.

    No further help to be offered, please, until the OP complies with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  4. #4
    Registered User
    Join Date
    07-20-2018
    Location
    Luxembourg
    MS-Off Ver
    2016
    Posts
    6

    Re: VBA Macro : HELPPPPPP!!!

    Quote Originally Posted by YasserKhalil View Post
    Hello
    Try this code
    Please Login or Register  to view this content.
    It DOES WORK!!! but it possible to "clean" the input line (E8:S8), so to say, once is saved, the range returns to blank?
    Last edited by Ransick; 07-20-2018 at 08:02 AM.

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,802

    Re: VBA Macro to Copy and Paste in a table

    You can clear the contents by referring to the range like that
    Please Login or Register  to view this content.
    Then using ClearContents method
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-20-2018
    Location
    Luxembourg
    MS-Off Ver
    2016
    Posts
    6

    Re: VBA Macro to Copy and Paste in a table

    Quote Originally Posted by YasserKhalil View Post
    You can clear the contents by referring to the range like that
    Please Login or Register  to view this content.
    Then using ClearContents method
    Please Login or Register  to view this content.
    Thank you. I just have one last question... as i do not want that people change the data from (E10) onwards, i have protected the sheet and while protected the macro does not work. it is possible that the macro "overwrites" the protection and does its function?

  7. #7
    Registered User
    Join Date
    07-18-2018
    Location
    Bella, Kafr El Sheikh, Egypt
    MS-Off Ver
    16.0
    Posts
    6

    Re: VBA Macro to Copy and Paste in a table

    Try this code with Sheet protection
    Please Login or Register  to view this content.
    Last edited by Eslam Abdullah; 07-20-2018 at 09:49 AM.

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,802

    Re: VBA Macro to Copy and Paste in a table

    Thanks a lot my friend Eslam
    Another way
    Please Login or Register  to view this content.

+ 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. [SOLVED] macro showing error ( macro not found ) while trying to execute macro every 1 minute
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2018, 07:58 PM
  2. [SOLVED] Define variable in macro than calling that macro inside another macro
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2015, 10:58 AM
  3. [SOLVED] Macro to show Which macro didnt work in a nested macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 03:21 AM
  4. Pivot Table
    By mayur.jilka in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-25-2012, 03:43 PM
  5. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  6. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  7. Cannot find macro error when running a macro from a macro in a diffrent workbook.
    By Acrobatic82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 09:22 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