VB question

[Closed]
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I need some help with excel. I have a work book i am trying to copy specific data from to another blank work sheet. The first workbook i will call 1 and the second will be 2. On 1 I need to copy specific rows by specific cell values. The code/marco will be stored on 2 and i would like to use this workbook as a template to pull data from different versions of workbook 1. I have a macro that will pull cells be the problem is if a new row is added the macro then pulls incorrect data. So i need a code that will copy a row onto sheet 2 based on values in column A, B, and E. However if there is not data in column E then i want to continue searching untill the cobination of a and b = a value and when E is not null.


2 replies

So basically what i need is a code that searches doc 1 for data in column A & B and copies where column E is not null.

Select * from config log
where A=1234 and B=Red and E is not null

copy A, B, E from config log
paste into template.
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
You can apply filter
copy the visible rows
paste the rows where you want
Well for worksheet one there is about 400 rows and i really only need about 80 rows of data. I had set up macro's to copy specific rows but the problem is when new rows are added i dont pull the right information. Thats why i am trying to use a search/query that picks specific values from column A, B and F and pastes them onto my parts template.
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
could you explain what you meant by " i dont pull the right information". May be better would be if you could post a sample workbook at some public file share site and post back the link to the file back here, it might be easier for you to show issue and for some one to suggest a solution
What I was trying to say was, if you can manually filter the data as you want, you can code it to do the same too. If for some reason you cannot manually fitler the data (example, i need 3 possible values for A etc) then one can come up with a workaround.