+ Reply to Thread
Results 1 to 3 of 3

Delete the all chosed column which is selected in combo box!!!!!!!!!!!!!

Hybrid View

END93 Delete the all chosed column... 03-28-2016, 10:22 AM
LeoTaxi Re: Delete the all chosed... 03-28-2016, 11:59 AM
END93 Re: Delete the all chosed... 03-28-2016, 12:25 PM
  1. #1
    Registered User
    Join Date
    03-15-2016
    Location
    Turkey
    MS-Off Ver
    2013
    Posts
    10

    Exclamation Delete the all chosed column which is selected in combo box!!!!!!!!!!!!!

    Hi Experts,

    I wrote a code below, It works like that the choosed text is deleted from Excel sheet. But to delete it I have to click CommandButton2 every time.
    I want that when I click command button once it should be delete all column which is choosed in combo box. It is urgent please help me rapidly.

    Private Sub CommandButton2_Click()
    Dim s As String
    s = ComboBox2.Text
    
    For i = 1 To 100
        If Range("b" & i).Value = s Then
        Rows([i]).EntireRow.Delete
        
        End If
        
    Next i
    Next i
    End Sub

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Delete the all chosed column which is selected in combo box!!!!!!!!!!!!!

    Maybe

    Private Sub CommandButton2_Click()
    Dim s As String, lastrow As Long
    s = ComboBox2.Text
    lastrow = Range("B" & Rows.Count).End(xlUp).Row
    For i = lastrow To 1 Step -1
        If Range("b" & i).Value = s Then
            Rows([i]).EntireRow.Delete
        End If
    Next i
    End Sub
    Kind regards
    Leo

  3. #3
    Registered User
    Join Date
    03-15-2016
    Location
    Turkey
    MS-Off Ver
    2013
    Posts
    10

    Re: Delete the all chosed column which is selected in combo box!!!!!!!!!!!!!

    Thanks Leo, It worked.

+ 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] List in Combo Box, when new item is selected put todays date in the adjacent column
    By Antligen in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-03-2014, 10:30 AM
  2. [SOLVED] Excel 2010 VBA – Combo Box Options– Clear cell/box in 2nd Combo when 1st Combo selected
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2013, 07:25 PM
  3. [SOLVED] Selecting in dropdown and when chosed only fill colors appear.
    By kms.official_mail in forum Excel General
    Replies: 9
    Last Post: 10-07-2012, 12:53 AM
  4. how to delete dublicates rom selected column
    By katya_p in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2012, 09:50 AM
  5. [SOLVED] delete row or column depending on which is selected
    By surfengine in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 04:32 PM
  6. Replies: 29
    Last Post: 11-22-2010, 03:51 PM

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