+ Reply to Thread
Results 1 to 3 of 3

Trying to find a value in a column, then select a range in that row to delete VBA

  1. #1
    Registered User
    Join Date
    12-04-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2010
    Posts
    3

    Trying to find a value in a column, then select a range in that row to delete VBA

    So I am working on a project where I need to find a UserForm ComboBox value on a worksheet, then select the range from that value (in Column A) to Column AD, then delete that selection and shift the cells up. Right now I have code to find the value but I can't figure out how to select that range of cells to delete. I am using this to find the value from the ComboBox.

    custid = cbo_customerid.Value

    If Trim(custid) <> "" Then
    With Sheets("Optimization Data").Range("A:A")
    Set custidopti = .Find(What:=custid, _
    After:=.Cells(.Cells.Count), _
    LookIn:=xlValues, _
    LookAt:=xlWhole, _
    SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, _
    MatchCase:=False)

    So from this cell I need to select the entire row to AD to delete. Any help would be great!

    Thanks!
    Last edited by miltonsrevenge; 12-06-2012 at 03:03 AM.

  2. #2
    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,197

    Re: Trying to find a value in a column, then select a range in that row to delete VBA

    Hi, miltonsrevenge,

    maybe like this (untested):
    Please Login or Register  to view this content.
    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

  3. #3
    Registered User
    Join Date
    12-04-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Trying to find a value in a column, then select a range in that row to delete VBA

    Works like a charm, thanks so much for your help!!

    All the best,
    Brian

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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