Results 1 to 20 of 30

Thread: How to keep Inserting Rows Command from moving other cells in a sheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Apr 2018
    Posts
    50
    Location

    How to keep Inserting Rows Command from moving other cells in a sheet

    I have 2 command buttons on excel 2010.
    everytime i click on the commandbuttons for each the other tables and cells seems be to effected. like everything is out of place. is there a vba for my vba codes to keep the other cells still while the user select the new row button.

    the codes i have for my command buttons:


    Private Sub CommandButton2_Click()
    Sheets("Sheet1").Range("A32").Select
    ActiveCell.EntireRow.Insert Shift:=xlDown
    
    
    Sheets("Sheet1").Range("A32:D32").Select
    Selection.Borders.Weight = xlThin
    End Sub
    
    
    Private Sub CommandButton1_Click()
    Sheets("Sheet1").Range("A15").Select
    ActiveCell.EntireRow.Insert Shift:=xlDown
    
    
    Sheets("Sheet1").Range("A15:D15").Select
    Selection.Borders.Weight = xlThin
    
    
    End Sub
    Last edited by Paul_Hossler; 05-11-2018 at 02:16 PM. Reason: Added CODE tags - use the # icon to insert them

Posting Permissions

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