+ Reply to Thread
Results 1 to 7 of 7

execute code in all selected cells

  1. #1
    Registered User
    Join Date
    07-08-2019
    Location
    GENT
    MS-Off Ver
    O365
    Posts
    13

    execute code in all selected cells

    Hi Folks

    I want to add a line "Chr(10)" at the beginning and end of all the selected cells.
    Here the code i am trying:

    Please Login or Register  to view this content.
    When selecting 3 cells, it adds 3 lines before and after the tekst in the last cell in the selection;
    not the request one line in front and at the end of the text in every cell.

    Must be simple, but I can't see it.
    Any help? Thx in advance
    Last edited by aTRc; 07-20-2019 at 09:15 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: execute code in all selected cells

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-08-2019
    Location
    GENT
    MS-Off Ver
    O365
    Posts
    13

    Re: execute code in all selected cells

    changes done!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: execute code in all selected cells

    Perfect - thanks.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: execute code in all selected cells

    How about
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-08-2019
    Location
    GENT
    MS-Off Ver
    O365
    Posts
    13

    Re: execute code in all selected cells

    This does the trick!
    Thank you very much...

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: execute code in all selected cells

    You're welcome & thanks for the feedback

+ 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. After code has selected 6 cells randomly have the code sums up that row
    By UltimateNeo in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-20-2019, 04:08 AM
  2. [SOLVED] Execute code when user double clicks on any cell within a range of cells
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-11-2019, 11:34 AM
  3. Change cells in code to my selected cell
    By Njineer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2018, 01:15 PM
  4. code to execute a keyboard shortcut or to execute a toolbar button
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2015, 12:16 PM
  5. [SOLVED] VBA Code Change Event Code When 2 cells are selected
    By bjnockle in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-16-2014, 06:08 PM
  6. [SOLVED] Applying code to the 'selected' cells only
    By CXsjr in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-14-2013, 02:49 AM
  7. Execute Events Based Upon Selected Cell
    By D.Parker in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-22-2005, 11:07 PM

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