+ Reply to Thread
Results 1 to 9 of 9

Delete Columns If any contain values

Hybrid View

  1. #1
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Delete Columns If any contain values

    From your sample file I gather it is only Column A to be cleared. Is that correct?
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  2. #2
    Forum Contributor
    Join Date
    08-28-2012
    Location
    nz
    MS-Off Ver
    Excel 2010
    Posts
    125

    Cool Re: Delete Columns If any contain values

    Hi Winon

    Hi

    You just Solved it for me, I didn't realise in the code that if i adjust the fist number





    Sub DeleDynamicGraphCols()

    Application.ScreenUpdating = False

    With Cells(1, Columns.Count).End(xlToLeft)
    If .Column > 35 Then
    Range(Cells(1, 35), .Offset(0, -1).Address).EntireColumn.Delete
    End If
    End With

    Application.ScreenUpdating = True

    End Sub





    to the same column as the one i want remaining, it won't delete any past there "Offset -1"

    After i went in to try and re create things for screen shots for you, as my actual spread sheet is set up different. Ha

    Thanks Mate

    Interaction helps

    Solved

    Mike. learning Vba slowly (Very)

+ 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. Delete values of duplicate rows only in specific columns
    By DeeBee in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-18-2013, 09:43 AM
  2. [SOLVED] Looking for VBA code to delete rows if values in 3 specific columns are the same
    By Priceman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2012, 10:32 AM
  3. Macro to Delete Values if in both columns
    By Enemee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2011, 08:10 AM
  4. Compare 2 columns delete rows with matching values
    By mattmac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-05-2009, 01:50 PM
  5. Compare two columns and delete founded values
    By Oleg in forum Excel General
    Replies: 0
    Last Post: 09-28-2006, 09:50 AM

Tags for this Thread

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