Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, Tried this code but could not get it to work. The data needs to be on the same spreadsheet and must go to designated locations. Also I got an error "Method 'Range of Object' worksheet failed" at this breakpoint: Range(mCell.Offset(1, 0), mCell.Offset(1, 3)).Copy Here is the code I have so far: Dim mCell, MyRange, MyCopy As Range Dim Ws1, Ws2 As Worksheet Dim mFound As Range Set Ws1 = Worksheets("10-16") Set Ws2 = Worksheets("Sheet2") 'Check the first column for the number Set MyRange = Ws1.Range("B129:E400") ' or whatever 'the range is" For Each mCell In MyRange If IsNumeric(mCell) And Not _ IsNumeric(mCell.Offset(0, 1).Value) Then Range(mCell.Offset(1, 0), mCell.Offset(1, 3)).Copy With Ws2.Columns("A") Set mFound = .Find _ (mCell, , LookIn:=xlValues) End With Ws2.Activate mFound.Offset(0, 1).Select Selection.PasteSpecial xlPasteAll End If Next Application.CutCopyMode = False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding a number within a range of numbers | Excel Worksheet Functions | |||
finding a number within a range | Excel Worksheet Functions | |||
Finding 2nd smallest number in range | Excel Worksheet Functions | |||
Finding the number of times a word is used in a range of cells | Excel Worksheet Functions | |||
Problems with a finding macro and copying a range of cells | Excel Programming |