R
R Krishna
hi
I have a macro to copy some data from one sheet to another. It works on the
first pass the second time it shows a na error, it says Range(Columns.Count
& "5").End....... =<Method"Range"of object"_Global" Failed>
what does this mean?, and how to I fix it?
TIA
Rkrishna
Dim MyRo As Long, DatCol As Long
MyRo = Range("A" & Rows.Count).End(xlUp).Row
DatCol = Range(Columns.Count & "5").End(xlToLeft).Column
Range("A1" & ":" & DatCol & MyRo).Select
Selection.Copy
Sheets(shname).Select
Range("A" & MyRow).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
'MyRow = Range("A" & Rows.Count).End(xlUp).Row
MyRow = MyRow + MyRo
Sheets(sname).Select
Range("A1" & ":" & DatCol & MyRo).Select
Application.CutCopyMode = False
Selection.Clear
Selection.QueryTable.Delete
Range("A1").Select
Next r
I have a macro to copy some data from one sheet to another. It works on the
first pass the second time it shows a na error, it says Range(Columns.Count
& "5").End....... =<Method"Range"of object"_Global" Failed>
what does this mean?, and how to I fix it?
TIA
Rkrishna
Dim MyRo As Long, DatCol As Long
MyRo = Range("A" & Rows.Count).End(xlUp).Row
DatCol = Range(Columns.Count & "5").End(xlToLeft).Column
Range("A1" & ":" & DatCol & MyRo).Select
Selection.Copy
Sheets(shname).Select
Range("A" & MyRow).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
'MyRow = Range("A" & Rows.Count).End(xlUp).Row
MyRow = MyRow + MyRo
Sheets(sname).Select
Range("A1" & ":" & DatCol & MyRo).Select
Application.CutCopyMode = False
Selection.Clear
Selection.QueryTable.Delete
Range("A1").Select
Next r