+ Reply to Thread
Results 1 to 10 of 10

How To Delete The Column using Macro

  1. #1
    Forum Contributor
    Join Date
    09-07-2013
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    114

    How To Delete The Column using Macro

    Hi.
    i want to Delete the particular column in my sheet. actually i want to delete column B & column D & column F, i used some code to delete but its deleting entire column between column B to F,,, please advice how to do it.
    Here with i mentioned what i was used.
    Please Login or Register  to view this content.
    Last edited by ganeshkumar; 12-05-2013 at 02:35 AM.

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: How To Delete The Column using Macro

    Hi,

    I would suggest you to delete it backwards :

    Please Login or Register  to view this content.
    Hope this helps.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: How To Delete The Column using Macro

    Hi, ganeshkumar,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    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, it also maintains VBA formatting.

    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



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Contributor
    Join Date
    09-07-2013
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: How To Delete The Column using Macro

    here with attached the my sheet. i want to delete the column B and E only ,not between B to E.
    Attached Files Attached Files
    Last edited by ganeshkumar; 12-05-2013 at 02:17 AM.

  5. #5
    Forum Contributor
    Join Date
    09-07-2013
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: How To Delete The Column using Macro

    okay thanks for information.. here after i will follow the rules

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: How To Delete The Column using Macro

    Hi, ganeshkumar,

    this is not an information!

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: How To Delete The Column using Macro

    Hi, ganeshkumar,

    I appreciate the effort you have taken to edit the opening post (the last command there should read [/code]).

    Either use the code suggested by xlbiznes like
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    A command like
    Please Login or Register  to view this content.
    would delete the range from B to E.

    Ciao,
    Holger

  8. #8
    Forum Contributor
    Join Date
    09-07-2013
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: How To Delete The Column using Macro

    Hi
    if i use ur code its deleting extra one column. that is, deleting column B & column C and column E & F ,why its happening .

  9. #9
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: How To Delete The Column using Macro

    Hi, ganeshkumar,

    not in the workbook you supplied as attachment - my guess is that in the original workbook you use MergedCells (because you think you need to, use Center Above instead), AFAIK no workaround when it comes to deleting a single column when any cell inside that column is merged as the merged column is deleted too.

    Ciao,
    Holger

  10. #10
    Forum Contributor
    Join Date
    09-07-2013
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: How To Delete The Column using Macro

    Thank you so much... i got it...

+ 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 to count unique values in a column, enter it in next column, then delete duplicates
    By pmorisse in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2013, 03:27 PM
  2. Macro to delete column in front of yellow highlighted column
    By Getsuko Teng in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-06-2012, 02:30 PM
  3. Run Macro Automatically When delete row , changes cell,delete column
    By elevisse in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2012, 07:42 AM
  4. Macro to delete certain columns and delete rows based on time in another column
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2012, 11:47 AM
  5. Macro to delete first row and insert column after a certain number of column
    By arnab0711 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2011, 08:36 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