473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
0 1112

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

Similar topics

1
by: sqlnewbie | last post by:
I'm a newbie to script writing. I'm trying to write a script to copy all data from a table to the same table in a 2nd database. Both databases are on the same server and are identical in design. ...
4
by: Ben Reese | last post by:
I need to copy (not move) a directory and all of its contents to another Location Disk / Server / Universe etc. But I cannot find a Copy method on the Directory or DirectoryInfo objects only a...
3
by: PeterZ | last post by:
Hi, In a running C# app with a datagrid control I select all rows in the dataGrid using CTRL-A, I then paste into some other app like notepad or Word but the column headings get left off. Is...
1
by: Silvester | last post by:
I need to drag drop & copy entire row contents from a Source databound datagridview to a Target unbound datagridview. Source is set to SelectionMode fullrowselect. I am not sure how to achieve...
1
by: svaradan | last post by:
Hi Is it possible to associate a datasource in a datagridview combobox to one cell and not to the entire column? If so how would I go about doing it? Sonny
3
by: Sheau Wei | last post by:
when the result print out , i want to make hyperlink for entire column of ID. what should i do?Below was my php code. //And we display the results while($result = mysql_fetch_array( $data )) ...
0
by: kath | last post by:
Hi.... XLRDError: Can't find workbook in OLE2 compound document What does this error means? When I try to open some excel files using XLRD, I encounter this error. Not with every excel, but...
5
by: Hokiecow | last post by:
I'm trying to import specific columns from an excel file (Requirements.xls) into an access table (tblRequirements). Using VBA, I'm able to import the entire excel file into table...
3
by: samj | last post by:
Looking at code examples, it would seem this is simple, but I can't figure it out. From an Access 2000 form command button, I want to copy all worksheets in an existing workbook to an existing...
4
by: omono84 | last post by:
I know that this should be rather simple but i seem to be missing a step to get it to work. and have been unable to find a solution on the net. The aim is that I click on the open button to find...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.