Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Please, somebody look at this code : (
Sub GetData()
Dim origin As String Dim orgn As Workbook, dest As Workbook Dim ws As Worksheet Dim wsIr As Worksheet Dim Firstrow As Long Dim LastRow As Long Dim Lrow As Long Set wsIr = Sheets("INTLraw") wsIr.Activate Range("A1").Select Application.ScreenUpdating = False origin = Application.GetOpenFilename("Microsoft Office Excel Files(*.xl*;*.xls;*.xla;*.xlm;*.xlc;*.xlw),*.xl*;* .xls;*.xla;*.xlm;*.xlc;*.xlw") If origin = "False" Then Exit Sub Workbooks.Open origin, 0, True Set orgn = ActiveWorkbook orgn.Activate Sheets(2).Activate Firstrow = ActiveSheet.UsedRange.Cells(1).Row LastRow = ActiveSheet.UsedRange.Rows.Count + Firstrow - 1 With ActiveSheet ..DisplayPageBreaks = False End With With orgn.Sheets(2) LastRow = wsIr.Cells(Rows.Count, "I").End(xlUp).Row Set MyRange = wsIr.Cells(LastRow, "I").Offset(1, -8) ..Range("A1", .Cells.SpecialCells(xlCellTypeLastCell)).Copy Destination:=MyRange.Paste End With WSI.Activate End Sub I am having problems with the line near the end reading ".Range("A1",......" Causes run-time error: Object doesn't support this property or method. Help? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Please, somebody look at this code : (
Drop the .paste from that line and I'd change the order--just for ease of
reading. LastRow = wsIr.Cells(Rows.Count, "I").End(xlUp).Row Set MyRange = wsIr.Cells(LastRow, "I").Offset(1, -8) With orgn.Sheets(2) .Range("A1", .Cells.SpecialCells(xlCellTypeLastCell)).Copy _ Destination:=MyRange End With justme wrote: Sub GetData() Dim origin As String Dim orgn As Workbook, dest As Workbook Dim ws As Worksheet Dim wsIr As Worksheet Dim Firstrow As Long Dim LastRow As Long Dim Lrow As Long Set wsIr = Sheets("INTLraw") wsIr.Activate Range("A1").Select Application.ScreenUpdating = False origin = Application.GetOpenFilename("Microsoft Office Excel Files(*.xl*;*.xls;*.xla;*.xlm;*.xlc;*.xlw),*.xl*;* .xls;*.xla;*.xlm;*.xlc;*.xlw") If origin = "False" Then Exit Sub Workbooks.Open origin, 0, True Set orgn = ActiveWorkbook orgn.Activate Sheets(2).Activate Firstrow = ActiveSheet.UsedRange.Cells(1).Row LastRow = ActiveSheet.UsedRange.Rows.Count + Firstrow - 1 With ActiveSheet .DisplayPageBreaks = False End With With orgn.Sheets(2) LastRow = wsIr.Cells(Rows.Count, "I").End(xlUp).Row Set MyRange = wsIr.Cells(LastRow, "I").Offset(1, -8) .Range("A1", .Cells.SpecialCells(xlCellTypeLastCell)).Copy Destination:=MyRange.Paste End With WSI.Activate End Sub I am having problems with the line near the end reading ".Range("A1",......" Causes run-time error: Object doesn't support this property or method. Help? -- Dave Peterson |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Please, somebody look at this code : (
GENIUS! That's what you are!
thanks for responding, even though I posted in the wrong forum. :) :) :) :) :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2 Questions | New Users to Excel | |||
code not unique find latest date | Excel Discussion (Misc queries) | |||
VLOOKUP for Zip Code Ranges | Excel Worksheet Functions | |||
Conform a total to a list of results? | Excel Discussion (Misc queries) | |||
Macro for changing text to Proper Case | Excel Worksheet Functions |