+ Reply to Thread
Results 1 to 9 of 9

Clear Data in row B24 up the last column containing Data

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,725

    Clear Data in row B24 up the last column containing Data

    I have the following macro below to clear data from B24 to the last col containing Data


    Please Login or Register  to view this content.


    It would be appreciated if someone could improve the code, although it works

  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,916

    Re: Clear Data in row B24 up the last column containing Data

    Obvious question: why? What do you mean by 'improve'?
    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
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Clear Data in row B24 up the last column containing Data

    One way.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,725

    Re: Clear Data in row B24 up the last column containing Data

    what I meant is to make the code look neater I.E. tidy the code

  5. #5
    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,916

    Re: Clear Data in row B24 up the last column containing Data

    But why? What's not neat about it? Who is going to be looking at it other than you?

    Don't waste time on aesthetics when they don't matter: if it ain't broke ...

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

    Re: Clear Data in row B24 up the last column containing Data

    Similar to bakerman2
    Please Login or Register  to view this content.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Clear Data in row B24 up the last column containing Data

    @ Ali

    Using Select, Selection is a textbook example of poor coding and is to be avoided as much as posssible.

    Keeping that in mind code can be 'improved' or tidied.

  8. #8
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,725

    Re: Clear Data in row B24 up the last column containing Data

    Thanks for the help

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

    Re: Clear Data in row B24 up the last column containing Data

    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. [SOLVED] clear a column with non-contiguous data
    By charliec in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2019, 03:08 PM
  2. Macro to clear data on Column
    By microhunt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2018, 11:53 AM
  3. Clear specified column after the data transfer
    By salmasaied in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-08-2016, 07:40 PM
  4. [SOLVED] Help request to clear the data in column 'AO'
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2016, 09:21 AM
  5. [SOLVED] VB to clear data every 4th column
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2016, 09:52 AM
  6. Clear Contents of column based on data in another column
    By wachao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2014, 02:39 AM
  7. [SOLVED] Clear contents of last column with data
    By avanir151 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2014, 03:45 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