Morning Clever People!
I have a very simple macros that I recorded and sits in my personal.xls.
I've now copied it into another worksheet and am getting strange results. The strangeness happens in the first two lines!
Sub Val_Hit_Rate()
Workbooks.OpenText Filename:="t:\TmpRpts\HIT_SCR1.900", Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 2), Array(8, _
9), Array(41, 9), Array(51, 9), Array(59, 1), Array(65, 9))
Rows("1:1").Insert Shift:=xlDown
When the code gets to the second line, it inserts a line at the top of the sheet containing the macro, not in the file I've just opened.
I even tried putting in a line to activate the right workbook, which it did, but still inserted the row in the other sheet.
It still works perfectly when I run it from personal.xls.
Any ideas?
Thanks
Colin
Bookmarks