LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Finding Number Within Range Then Copying Data Below Number to Cells


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding a number within a range of numbers ukbandit Excel Worksheet Functions 2 October 8th 09 01:08 PM
finding a number within a range Cathy Landry Excel Worksheet Functions 6 April 10th 09 08:45 PM
Finding 2nd smallest number in range Rachel7 Excel Worksheet Functions 8 February 12th 09 02:33 PM
Finding the number of times a word is used in a range of cells Ray Hill Excel Worksheet Functions 8 January 15th 09 07:21 PM
Problems with a finding macro and copying a range of cells Agasnine Excel Programming 1 November 20th 05 07:19 PM


All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"