ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,731
- Office Version
- 2007
- Platform
- Windows
Morning,
On my worksheet i have customers name in column A & their values on that row.
Sometimes i need to move them up or down the page.
So for that i do the following.
Customer say is currently at row 10 & i need to move them to row 28
I select their name in column A, my userform opens which has basicalyy just copied the rows values & i am then asked what row to place these values in.
I enter 28 in the input field & the values are now placed in the row i entered being row 28
NOW i wish to delete the details from row 10 & this is where i need the advice please as currently im scrolling up / down looking for it.
On my worksheet i have customers name in column A & their values on that row.
Sometimes i need to move them up or down the page.
So for that i do the following.
Customer say is currently at row 10 & i need to move them to row 28
I select their name in column A, my userform opens which has basicalyy just copied the rows values & i am then asked what row to place these values in.
I enter 28 in the input field & the values are now placed in the row i entered being row 28
NOW i wish to delete the details from row 10 & this is where i need the advice please as currently im scrolling up / down looking for it.
Rich (BB code):
Private Sub CommandButton1_Click()
Dim i As Integer
Dim ControlsArr As Variant, ctrl As Variant
Dim x As Long
Dim z As Integer
z = CInt(Application.InputBox("WHICH ROW SHOULD DATA BE INSERTED INTO ?", "NEW CUSTOMER ROW NUMBER MESSAGE", Type:=1))
ControlsArr = Array(Me.TextBox1, Me.TextBox2, Me.TextBox3, Me.TextBox4, Me.TextBox5, Me.TextBox6, Me.TextBox7, Me.TextBox8, Me.TextBox9, Me.TextBox10, Me.TextBox11)
With ThisWorkbook.Worksheets("GRASS")
.Rows(z).EntireRow.Insert Shift:=xlDown
.Rows(z).RowHeight = 25
.Rows(z).Font.Color = vbBlack
.Rows(z).Font.Bold = True
.Rows(z).Font.Size = 16
.Rows(z).Font.Name = "Calibri"
Range(.Cells(z, "A"), .Cells(z, "l")).Borders.LineStyle = xlContinuous
Range(.Cells(z, "A"), .Cells(z, "l")).Borders.LineStyle = xlContinuous
For i = 0 To UBound(ControlsArr)
Select Case i
Case -1
.Cells(z, i + 1) = Val(ControlsArr(i))
ControlsArr(i).Text = ""
Case Else
.Cells(z, i + 1) = ControlsArr(i)
ControlsArr(i).Text = ""
End Select
Next i
End With
ActiveWorkbook.Save
Unload MoveCustomerRow
End Sub