VBA to Delete Multiple Columns based on Headers - Excel VBA Macro Example

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 มิ.ย. 2019
  • This Tutorial explains Simple VBA Code to delete specific columns in Excel. We can use Columns Object of worksheet to delete entire column based on header. This example also covers how to delete blank columns and how to delete column based on criteria.

ความคิดเห็น • 36

  • @MohAboAbdo
    @MohAboAbdo 5 ปีที่แล้ว

    Thank you very much for this simple and wonderful code.

  • @adriennehong4804
    @adriennehong4804 4 ปีที่แล้ว +1

    This is brilliant, thank you so much for posting this! I'm a VBA novice and have been trying to figure out how to set multiple if statements one after another.

    • @ExcelDestination
      @ExcelDestination  4 ปีที่แล้ว

      Thanks! For any Excel VBA projects, you can write to EXCELDESTINATION@GMAIL.COM

  • @shabarilucky5
    @shabarilucky5 5 ปีที่แล้ว

    hi ,if we want to select and delete data between the rows, ( ex in my Qty colum ,, if i want to remove the Qty=0/ nill i want to delete those rows data. can you pelase hep in VAB query for it

  • @jmd.5899
    @jmd.5899 3 ปีที่แล้ว +2

    I have a separate table on a different worksheet, how can I refer to that to delete my columns? Do I need to set my table as an array first then reference to its individual cells for deleting my headers? Thanks

  • @tlee7028
    @tlee7028 2 ปีที่แล้ว +1

    Thank you , great tutorial and easy to follow.

  • @andreluizsales3286
    @andreluizsales3286 3 ปีที่แล้ว +1

    Thank you very much !

  • @sergiovic1
    @sergiovic1 3 ปีที่แล้ว +1

    Worked perfectly! Thanks!

  • @scottbennett9168
    @scottbennett9168 5 ปีที่แล้ว +3

    Can you use an “or” instead of writing code for both?

  • @KeiKam
    @KeiKam 3 ปีที่แล้ว +2

    Great stuff Sir, thanks for you help. I have just one question. It works well if you have specific value in single cell. It doesnt`t delete columns that are merged. Any advise ?

  • @healingmusicofficial2643
    @healingmusicofficial2643 3 ปีที่แล้ว +2

    Hi, thank you so much! this is very informative. Just a question how about if you wanted to delete multiple columns based on the cell value, say to delete columns with cell value greater than 50%. What could be the formula for this one? thanks in advance!

    • @ExcelDestination
      @ExcelDestination  3 ปีที่แล้ว

      you can take some idea from following tutorial :
      th-cam.com/video/7QMeYWX0JYk/w-d-xo.html

  • @Mmmichaeeel
    @Mmmichaeeel 2 หลายเดือนก่อน

    Hi! How can i loop this macro onto other sheets? Thank you in advance :)

  • @kosalaamarasinghe9131
    @kosalaamarasinghe9131 2 หลายเดือนก่อน +1

    Really helpful. Gr8

  • @jaypeehernandez4029
    @jaypeehernandez4029 4 ปีที่แล้ว +2

    This is helpful, The only problem I found in this code is, If you have the same column header and they are placed next to each other then it will only delete the first one since the columns will move to left and the loop will proceed to the next column.

  • @user-zb2cw9rp8y
    @user-zb2cw9rp8y 7 หลายเดือนก่อน +1

    Excelente!

  • @thevetominator4661
    @thevetominator4661 3 ปีที่แล้ว +1

    Greetings, first of all, allow me to express my gratitude for your video, it was very helpfull. But... now I'm having an Issue where it is not deleting al of the Columns which I have Input (about 15 Columns). Or... do I need a different approach for so many Columns at once!?

  • @skhussain4965
    @skhussain4965 2 ปีที่แล้ว

    If column number are changing then what code can be used? Please help

  • @shalinigupta1419
    @shalinigupta1419 5 ปีที่แล้ว

    thanks

  • @gauravgfatm
    @gauravgfatm 4 ปีที่แล้ว +1

    Hi, unable to delete multiple columns after using vba micros (as per video). How can i delete multiple columns in specific database.

    • @ExcelDestination
      @ExcelDestination  4 ปีที่แล้ว

      this tutorial is for deleting only one column. If you want to delete multiple columns, there would be different code. you can write to exceldestination@gmail.com for any excel vba support.

  • @saggi9999
    @saggi9999 5 หลายเดือนก่อน

    Is there any way to delete row

  • @heavenflora6325
    @heavenflora6325 2 ปีที่แล้ว

    How to delete columns as per header value from multiple sheet using vba(same header value in all sheet)

  • @namratamaurya3177
    @namratamaurya3177 5 ปีที่แล้ว

    What will be code in case if we want to delete data in 4th column, and let column to be exist

    • @ExcelDestination
      @ExcelDestination  5 ปีที่แล้ว

      if sheet name is "Sheet1" and you want to delete data from entire column then code is : worksheets("Sheet1").range("D:D").value=" "

  • @gayathrithakur4597
    @gayathrithakur4597 4 ปีที่แล้ว +1

    Sir if we have to delete more than 20 columns then...wt will be the code

  • @maheshpawar8567
    @maheshpawar8567 4 ปีที่แล้ว

    How many columns we delete at time?
    I have 323 columns with same name, i want to delete that columns at time, kindly assist. Or share is code for the same.

    • @maheshpawar8567
      @maheshpawar8567 4 ปีที่แล้ว +1

      Out of 323 - 300 column name is same & need only 23 column.

    • @ExcelDestination
      @ExcelDestination  4 ปีที่แล้ว

      You can loop through column names and use if condition within loop. Try at your end if it does not happen then send me your file only with column names, I will add the code. Thanks for watching!

  • @saradamajumder1362
    @saradamajumder1362 4 ปีที่แล้ว +1

    Sir can I get for java bluej

  • @IMANSHAPOORO
    @IMANSHAPOORO 5 ปีที่แล้ว

    Lebih baik jika di lampirkan file contohnya