Results 1 to 2 of 2

Thread: [RESOLVED] Prevent drop down list from moving when column deleted.

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2012
    Posts
    12

    Resolved [RESOLVED] Prevent drop down list from moving when column deleted.

    I have a spreadsheet that has a few drop down lists. The problem I will encounter is when data is pasted onto a tab, said data will fill columns A-J, columns A & B will be deleted, thus the last header will be in column H, as it should. My drop down code works, but moves when columns A and B are deleted. Is there a way to prevent this?

    Code:
    Sub CreateDV()
    With Range("$H$2:$H$50").Validation
      .Delete
      .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
      xlBetween, Formula1:="Yes,No"
      .IgnoreBlank = True
      .InCellDropdown = True
      .InputTitle = ""
      .ErrorTitle = ""
      .InputMessage = ""
      .ErrorMessage = ""
      .ShowInput = True
      .ShowError = True
    End With
    End Sub

  2. #2
    Addicted Member MetalInquisitor's Avatar
    Join Date
    Sep 2012
    Posts
    143

    Re: Prevent drop down list from moving when column deleted.

    You should ask in the Office Development (VBA) section of the forum. This section is for VB.NET.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width