Just to show that I have set up wswkname correctly -
Early in the sub the following code lines execute, in the 'initialisation' part of the sub, and the values work elsewhere perfectly well.
Dim ws As WorksheetDim wswkname As String
Set ws = ActiveSheet
wswkname = ws.Name
I have read and understood the following example code -
Worksheets(“Insert row”).Rows(“11:15”).Insert Shift:=xlShiftDown
I,. though, want the literals 11 and 15 to be variables. I have assigned the necessary variables to two variables, which are named fxRI1 and fxRI2.
Accordingly I wrote the following code
Dim fxRI1 As LongDim fxRI2 As Long
fxRI1 = sLast_Row.Value + 3fxRI2 = sLast_Row.Value + 4 ' sLast_Row.Value is a form value passed to the Sub
This 'construct' would not compile though.
View best response
It turned out that the statement needed some extra quotes as per following -
Worksheets(wswkname).Rows(fxRI1 & ":" & fxRI2).Insert Shift:=xlShiftDown