Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some code that calculates how many lines I need to copy from one
worksheet to another, but when I do the copy I get an errormessage. Here is part of my code: Private Sub Start_Click() Dim lastline As Integer Dim MalWb, RappWb As Workbook Workbooks.OpenText Filename:=RapportFrm.Innfil.Value, Origin:=xlWindows, StartRow:=1, _ DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter _ :=False, Tab:=False, Semicolon:=False, Comma:=False, Space:=False, _ Other:=True, OtherChar:="""", FieldInfo:=Array(Array(1, 9), Array(2, 1), _ Array(3, 9), Array(4, 1), Array(5, 9), Array(6, 1), Array(7, 9), Array(8, 1), Array(9, 9), _ Array(10, 1), Array(11, 9), Array(12, 1), Array(13, 9), Array(14, 1), Array(15, 9)), _ DecimalSeparator:=".", TrailingMinusNumbers:=False Worksheets(1).Name = "Rapport" ' Some code to calculate lastline Set RappWb = Workbooks(ActiveWorkbook.Name) Workbooks.Open RapportFrm.MalFil.Value Set MalWb = Workbooks(ActiveWorkbook.Name) 'Not working RappWb.Worksheets("Rapport").Range(Cells(2, 1), Cells(lastline - 1, 8)).Copy MalWb.Worksheets("Resultat").Cells(7, 1) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy method of worksheet class failed: trying to copy a hidden she | Excel Programming | |||
copy method of worksheet class failed: trying to copy a hidden she | Excel Programming | |||
copy method of worksheet class failed: trying to copy a hidden she | Excel Programming | |||
copy range on every worksheet (diff names) to a master worksheet (to be created) | Excel Programming | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming |