VBA Code require

Vrushal

New Member
Joined
Feb 13, 2020
Messages
2
Office Version
2016
Platform
Windows
Dear All,

I am Trying to build VBA code but not able to solve the problem and end-up with error. Any help in the code is Appreciated and Thank you for Help.

Set up is ---
there are number of worksheet in workbook and i need to run code in each worksheet.
Each Worksheet have three two Range Area ("A:I") & ("W:AF")

I want to Search for each raw value of Column "Y" in Column "C" of Range ("A:I") , if Value found Cut Row of range ("W:AF") of which value search and paste from Column "J" corresponding to Value found in column "C".
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
9,648
Office Version
2007
Platform
Windows
Hi and welcome to MrExcel

In a copy of your book try the following macro:

VBA Code:
Sub CopyValues()
  Dim sh As Worksheet, f As Range, c As Range
  Application.ScreenUpdating = False
  For Each sh In Sheets
    For Each c In sh.Range("Y1", sh.Range("Y" & Rows.Count).End(xlUp))
      If c.Value <> "" Then
        Set f = sh.Range("C:C").Find(c.Value, , xlValues, xlWhole)
        If Not f Is Nothing Then
          f.Offset(0, 7).Resize(1, 10).Value = c.Offset(0, -2).Resize(1, 10).Value
          c.Offset(0, -2).Resize(1, 10).Value = ""
        End If
      End If
    Next
  Next
End Sub
 

Vrushal

New Member
Joined
Feb 13, 2020
Messages
2
Office Version
2016
Platform
Windows
Thank you Sir,

Code is perfectly working. Code is part of Excel Utility but it is very important and where i was stucked. Thank you once again as this code complete my Excel utility.
 

Forum statistics

Threads
1,085,183
Messages
5,382,174
Members
401,779
Latest member
Thonor

Some videos you may like

This Week's Hot Topics

Top