[Shift] Arguments for Range.Delete()

  • Re: [Shift] Arguments for Range.Delete()


    Sure; I want to take an ActiveCell and delete it if its value is "-", shifting cells up whenever I do so. The final code should look like this.


    Code
    Do While ActiveCell.Value > 0
         If ActiveCell.Value = "-" Then
              'To Shift Cells up in that row...
              ActiveCell.Delete(****)
         Else
              'Do something else...
         End If
         ActiveCell.Offset(1, 0).Select
    Loop
  • Re: [Shift] Arguments for Range.Delete()


    On a blank worksheet, put some data into several cells.


    Select a cell and turn on the macro recorder. From the menu, Edit>Delete...>Shift cells up>OK.


    Turn off the macro recorder and go to VBE and check out the code.

    Barbara - aka The Cat Lady :cat:


    Please do not U2U (private message) me directly for questions that should be posted to the forum; any such U2Us, unless requested by me, will be deleted.

  • Re: [Shift] Arguments for Range.Delete()


    Alternative, in VBE type Activecell.Delete and then press F1. This should take you to the keyword search in VBA Help.

    Barbara - aka The Cat Lady :cat:


    Please do not U2U (private message) me directly for questions that should be posted to the forum; any such U2Us, unless requested by me, will be deleted.

  • Re: [Shift] Arguments for Range.Delete()


    If your still in need of the information. This from VBA Help



Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!