• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Script required

Dear All,

Please help me with the VBA Script.

In the Attached file in sheet 1 there is a combo box. If we select Name 1. The blank data's should be filled with the reference of Sheet1!C6. But datas are taken from diffrent sheet. In Sheet1!D:D I have mentioned all sheet name as it is. I want to use the sheet Name as reference to take the data.
 

Attachments

  • VBA.xlsm
    21.1 KB · Views: 8
Hi,

Use the below formula in cell E6. No changes when copying across but when coping down you need to change the sheet name

=SUMPRODUCT(('P1'!$A$2:$A$11=$C$6)*(Sheet1!$E$5:$P$5=E$5)*(('P1'!$B$2:$M$11)))

To make to work when combobox value changed fix Cell C6 as the linked cell in your combobox properties
 
Dear Lakshmi

Or use this formula in E6 and copy down and across (without making changes).

=VLOOKUP($C$6,INDIRECT("'"&$D6&"'!$A$2:$M$11"),COLUMN(B6),FALSE)
 
Dear Lakshmi

Or use this formula in E6 and copy down and across (without making changes).

=VLOOKUP($C$6,INDIRECT("'"&$D6&"'!$A$2:$M$11"),COLUMN(B6),FALSE)
Thanks Jack Collins,
Can you help me with macros. Actually i have huge data if i use formula it will take few sec for calculation.
I Tried with If condition in VBA. But i am beginner for VBA. I dont know how to make another loop for another sheet.
 
Well if you really need a macro then you would need a statement such as

For each Sheet in Sheets
If left(sheet.name,1)= "p" then

end if
next Sheet
 
Hi,

Use the below formula in cell E6. No changes when copying across but when coping down you need to change the sheet name

=SUMPRODUCT(('P1'!$A$2:$A$11=$C$6)*(Sheet1!$E$5:$P$5=E$5)*(('P1'!$B$2:$M$11)))

To make to work when combobox value changed fix Cell C6 as the linked cell in your combobox properties
Dear Sathish,
Thanks for your reply,
Its working like V look up but not checking in another sheet. Can you help me with macro.
 
Hi Lakshmi,

Mean time somebody turn up with Macro solution here is a formula solution, note I cant comment on it's performance on a large data set. It's just an idea.

Regards,
 

Attachments

  • VBA.xlsm
    24.4 KB · Views: 3
Back
Top