Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
i have 2 sheets as below column c J row 6 511 285 row 7 285 row 8 422 625 sheet2 col b m row 100 510 row 105 511 285 row 120 282 row 125 285 row 800 422 625 find sheet1 511 and 422 in sheet2 (because value next to them is 0) then put next to them 285 and 625 in sheet2 from sheet1 thanks in advance regards, Eddy stan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On May 14, 4:59*am, Eddy Stan
wrote: Hi all, i have 2 sheets as below column * * c * * * *J row 6 * * *511 * *285 row 7 * * *285 row 8 * * *422 * *625 sheet2 * * * col b * m row 100 * * *510 row 105 * * *511 * 285 row 120 * * *282 * row 125 * * *285 row 800 * * *422 * 625 find sheet1 511 and 422 in sheet2 (because value next to them is 0) then put next to them 285 and 625 in sheet2 from sheet1 thanks in advance regards, Eddy stan something like this Option Explicit Sub m() Dim ws1 As Worksheet Dim ws2 As Worksheet Set ws1 = Worksheets("sheet1") Set ws2 = Worksheets("sheet2") Dim rng1 As Range Dim rng2 As Range Dim frow As Integer Dim c As Range Set rng1 = ws1.Range("C6:C8") Set rng2 = ws2.Range("B100:B800") On Error Resume Next For Each c In rng1 If c.Offset(0, 7) 0 Then frow = rng2.Find(c).Row If frow 0 Then ws2.Cells(frow, "M") = c.Offset(0, 7) frow = 0 End If Next c End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find/Replace Event or Find/Replace for Protected Sheet ... | Excel Programming | |||
find duplicate entry and replace across sheets | Excel Programming | |||
find replace in multiple sheets based on namebox | Excel Discussion (Misc queries) | |||
FIND AND REPLACE DATA BETWEEN TWO EXCEL SHEETS USING FORMULA | Excel Discussion (Misc queries) | |||
Find / Replace sheets vs workbook in VB | Excel Worksheet Functions |