Hi folks
I've managed to put together my first Userform from advice on here and put together my macro again with information from this site but I have hit a brick wall.
Running the below brings up my form, allows me to enter values (e.g. ExtV = 10 and IntV = 10) but the error message
"Run-time error '13' Type mismatch" appears.
The highlighted error row is
Rows("RowE:RowE+ExtV").Select
(and I'd assume this will be next)
Rows("RowI:RowI+IntV").Select
Basically I want the value entered in the form for "ExtV" to insert a rows after the word "Decking" appears in column A.
I then want to insert "IntV" number of rows in the next unused cells in the column.
Hence in both instances, needing to know RowI and RowE.
Any help would be greatly appreciated.
I've managed to put together my first Userform from advice on here and put together my macro again with information from this site but I have hit a brick wall.
Running the below brings up my form, allows me to enter values (e.g. ExtV = 10 and IntV = 10) but the error message
"Run-time error '13' Type mismatch" appears.
Code:
Sub Enter_Click()
Dim IntV As Integer
Dim ExtV As Integer
Dim RowE As Long
Dim RowI As Long
Worksheets("VOs").Activate
'Determine the next row dependent on type
RowE = Sheets("VOs").Application.WorksheetFunction.Match("DECKING", Range("A1:A2000"), 0)
RowI = Sheets("VOs").Application.WorksheetFunction.CountA(Range("A:A")) + 1
'Select range of rows to insert new rows
Rows("RowE:RowE+ExtV").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Rows("RowI:RowI+IntV").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
On Error GoTo 0
Unload VOrow
VOrow.Hide
End Sub
The highlighted error row is
Rows("RowE:RowE+ExtV").Select
(and I'd assume this will be next)
Rows("RowI:RowI+IntV").Select
Basically I want the value entered in the form for "ExtV" to insert a rows after the word "Decking" appears in column A.
I then want to insert "IntV" number of rows in the next unused cells in the column.
Hence in both instances, needing to know RowI and RowE.
Any help would be greatly appreciated.
Last edited: