Formula in worksheet event code

adamsm

Active Member
Joined
Apr 20, 2010
Messages
444
Hi,

How could the following formula be placed in a worksheet event code?

=IF(F21="","",VLOOKUP(F21,Products!$A$3:$E$1329,IF(O$10="Credit",5,5),0))

Column headers are in row 17. And data rows start from row 18.

Any help on this would be kindly appreciated.

Thanks in advance.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Describe, in words, what you are trying to achieve overall.
 
Upvote 0
What I want in detail is; when I type a code such as 0001 in column F of the sheet “NewOrder”, the Item Category from the column G of the products sheet for that code to get copied to the column H on to the same row(of sheet "New Order").

Any help on this would be kindly appreciated.

Thanks in advance.
 
Upvote 0
What I want in detail is; when I type a code such as 0001 in column F of the sheet “NewOrder”, the Item Category from the column G of the products sheet for that code to get copied to the column H on to the same row(of sheet "New Order").

Any help on this would be kindly appreciated.

Thanks in advance.

Your description in words does not match your formula. In your formula the furthest right column referenced in the Product sheet is E ( yet you say that you want data from column G returned ).

Also, in your formula, you have some spurious logic:
=IF(F21="","",VLOOKUP(F21,Products!$A$3:$E$1329,IF(O$10="Credit",5,5),0))
The highlighted part does nothing, i.e. it always returns the number 5, no matter what. Why is it in there? Is it a mistake? Should the logic be different?
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,151
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top