Hi,
I am trying to create a macro to insert a new row in a protected sheet,
I am trying to insert a match function into VB to find the last row on the worksheet and came accross ".worksheet function".
Now, I have seemed to get my head around it up until I insert some text (&":"&). The formula works because I have tried it in excel. Formula in VB as follows:
Rows.Application.WorksheetFunction.MATCH("1 end",worksheet(timesheet).range("A:A"),0).value-1&":"&WorksheetFunction.MATCH("1 end",worksheet(timesheet).range("A:A"),0).value-1.Select
On another note is there a easier way of finding a row number than using two matches i.e. so it returns 1:1 (For example), formula in excel as follows =(MATCH("1 end",A:A,0))-1&":"&(MATCH("1 end",A:A,0))-1
Many thanks,
Kyle
I am trying to create a macro to insert a new row in a protected sheet,
I am trying to insert a match function into VB to find the last row on the worksheet and came accross ".worksheet function".
Now, I have seemed to get my head around it up until I insert some text (&":"&). The formula works because I have tried it in excel. Formula in VB as follows:
Rows.Application.WorksheetFunction.MATCH("1 end",worksheet(timesheet).range("A:A"),0).value-1&":"&WorksheetFunction.MATCH("1 end",worksheet(timesheet).range("A:A"),0).value-1.Select
On another note is there a easier way of finding a row number than using two matches i.e. so it returns 1:1 (For example), formula in excel as follows =(MATCH("1 end",A:A,0))-1&":"&(MATCH("1 end",A:A,0))-1
Many thanks,
Kyle