ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
I am using the code below.
All works well but i now need an edit so when the new row is inserted its row height is 30
In the code below you will see what ive entered in Red but i then see a RTE 438 Doesnt support this property or method
All works well but i now need an edit so when the new row is inserted its row height is 30
In the code below you will see what ive entered in Red but i then see a RTE 438 Doesnt support this property or method
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))
For i = 1 To 9
With Me.Controls("TextBox" & i)
If .Text = "" Then
MsgBox "ALL FIELDS MUST BE COMPLETED", 48, "GRASS NEW CUSTOMER FORM"
.SetFocus
Exit Sub
End If
End With
Next i
ControlsArr = Array(Me.TextBox1, Me.TextBox2, Me.TextBox3, Me.TextBox4, Me.TextBox5, Me.TextBox6, Me.TextBox7, Me.TextBox8, Me.TextBox9)
With ThisWorkbook.Worksheets("GRASS")
.Rows(z).EntireRow.Insert Shift:=xlDown
.RowHeight = 30
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 GRASSNEWCUSTOMER
MsgBox "DATABASE HAS NOW BEEN UPDATED", vbInformation, "SUCCESSFUL MESSAGE"
End Sub