VBA Code require

Vrushal

New Member
Joined
Feb 13, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. 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".
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
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
 
Upvote 0
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.
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top