Hi all,
I am new to the VBA.I need to help form u ppl.Please find tha attched example workbook.In that i have table 1 and table 2.I need to fill tha values in the table-2 based on the value in the table-1. How do we do that in macro?
Hi all,
I am new to the VBA.I need to help form u ppl.Please find tha attched example workbook.In that i have table 1 and table 2.I need to fill tha values in the table-2 based on the value in the table-1. How do we do that in macro?
For your specific example that is attached, invoke this formula in B16 and copy across to C16 and then down to C18. It should give you the desired results.
=SUMPRODUCT(--($A$4:$A$9=B$15),--($B$4:$B$9=$A16)*($C$4:$C$9))
Hope that helps.
thanks for ur response.
How shall i do that in macro?
thanks for ur response.
How shall i do that in macro?
Hi
These are my first thoughts for this problem.
To implement this is VBA, you can use the ADO or DAO objects and query the table. You can create a Select statment something like
Select Values from [SheetName$] Where Location like 'Chennai' and Desc like 'Temperature'
Get the value in the recordset and update them in the required cells.
Let me know if you need further assistance with this method. There can defintely be a quicker and more flexible way of doing this, but these are my initial thoughts.
Cheers
Raja
since i am new to VBA. I am not sure about "how to work with ADO objects and query.
Could u pls help me out in this?
Here you go, I have created a function GETVALUES which would take Location and Desc as input and will return you the Value corresponding to it.
thank u very much for ur help
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks