By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,304 Members | 3,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,304 IT Pros & Developers. It's quick & easy.

In VBA, Find dat, if its there in workbook, copy of entire column, if not i want chec

P: n/a
I have two workbook, one is master file, i want some data pick up from master file how i can use find, if the data is available, copy of entire column & past another work if its not there i want check another data...please give advice...

For your reference:

Expand|Select|Wrap|Line Numbers
  1. Dim rFound As Range
  2.  
  3.       ActiveWindow.ActivateNext
  4.     Range("A1").Select
  5.     Selection.AutoFilter
  6.     Range("A1").Select
  7.     Selection.End(xlToRight).Select
  8.     Selection.AutoFilter Field:=131, Criteria1:="Y"
  9.     Selection.AutoFilter Field:=129, Criteria1:="=>=60%"
  10.     ActiveWindow.ActivateNext
  11.     'cc = Range(Selection, Selection.End(xlDown)).Select
  12.     For i = 1 To 35
  13.     Sheets("MPI-Total").Select
  14.     Sheets("MPI-Total").Range("A24").Select
  15.     x = Sheets("MPI-Total").Cells(24, i)
  16.     ActiveWindow.ActivateNext
  17.     On Error Resume Next
  18.     With Sheet1
  19. Set rFound = Cells.Find(What:=x, After:=ActiveCell, LookIn:=xlFormulas, _
  20.         LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
  21.         MatchCase:=False, SearchFormat:=False).Activate
  22.  
  23.            ' On Error GoTo 0
  24.  
  25.         If Not rFound Is Nothing Then Application.Goto rFound, False
  26.  
  27.     End With
  28.  
  29.                                   ActiveCell.Select
  30.   Selection.EntireColumn.Select
  31.      Selection.Copy
  32.     ActiveWindow.ActivateNext
  33.     Cells(25, i).Select
  34.         Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
  35.         :=False, Transpose:=False
  36.  
  37.     'MsgBox x
  38.  
  39.     Next i
Oct 19 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.