Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste Range to New Workbook
Hi Folks,
Still a beginner and winging my way through.... Trying to write some code to workthrough a column, select the row according to some condition and copy it to a new workbook (with the header row - Range("1:1"). This should be a relatively simple task however, for some reason when I get to the Selection.Paste command I get the error: Run-time error '438': Object doesn't support this property or method. I've tried a number of different options to no avail. Does anyone have any suggestions as to how I might resolve this issue? Your help would be most appreciated. Current code as follows: Sub PasteRowToNewWB() Dim r As Integer Dim CellVal As String Sheets("Actions").Select For r = 2 To LastRowWithData() 'Function returns number of last row with data. CellVal = Cells(r, 9).Text If CellVal = "Overdue" Then Range("1:1", r & ":" & r).Select Range("A3").Activate Selection.Copy Workbooks.Add ActiveWorkbook.Sheets("Sheet1").Activate 'MsgBox "The active worksheet is: " & Worksheet.Name Selection.Paste End If Next r End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to copy a range of cells and paste into a new workbook in differentcolumns | Excel Discussion (Misc queries) | |||
Paste Filtered Range to New Workbook- AS | Excel Discussion (Misc queries) | |||
I cannot paste from one workbook to another. Copy works, paste do. | Excel Discussion (Misc queries) | |||
Need a macro to copy a range in one workbook and paste into another workbook | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming |