Excel VBA drop down populate cells

Sandro1985

New Member
Joined
Apr 11, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
i am currently trying the following.

if you select under column "K" (Equip/Serv) "Lumpsum" i want the user to be able to manually enter a value in column "P" Unit price.

if the user selects from the drop down menu in column "K" example "Lifting Gear" the value in "P" should be automatically populated from the DATA sheet.

For the "Lumpsum", the formular at present will be overwritten when keying in manually a value.

If not wrong, the above could be achieved with VBA, just looking around to figure out whether someone is able to help on this portion.


Template.xlsx
ABCDEFGHIJKLMNOPQR
1Customer Name - Job Summary Last Update: 12/04/2024
2 Update By:
3
4
5IDJob DateMonthYearStart TimeEnd TimeOrderd BySMP Job #SMP InvoiceCustomer PO#Equp. / Serv.QtyPlace of WorkFrom To Unit Rate Lumpsum Remarks
61  Lifting Gear 500.00-
72  Lumpsum--
83  Lifting Team 1,000.00-
9Total-
Work summary
Cell Formulas
RangeFormula
R1R1=TODAY()
C6:C8C6=IF([@[Job Date]]="","",TEXT([@[Job Date]],"mmmm"))
D6:D8D6=IF([@[Job Date]]="","",YEAR([@[Job Date]]))
A6:A8A6=ROW()-5
P6:P8P6=IFERROR(VLOOKUP([@[Equp. / Serv.]],DATA!A:B,2,FALSE),"")
Q6:Q8Q6=IFERROR([@[Unit Rate]]*[@Qty],"")
Q9Q9=SUBTOTAL(109,[Lumpsum])
Cells with Conditional Formatting
CellConditionCell FormatStop If True
N6:O8Expression=$M6<>""textNO
M6:M8Expression=$N6<>""textNO
Cells with Data Validation
CellAllowCriteria
K6:K8List=$T6#
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
If not wrong, the above could be achieved with VBA, just looking around to figure out whether someone is able to help on this portion.
Welcome to the forum

Simply add an IF condition like

Excel Formula:
=IF([@[Equp. / Serv.]]="Lumpsum","",IFERROR(VLOOKUP([@[Equp. / Serv.]],DATA!A:B,2,FALSE),""))

This way it should give you a blank (appearing) cell in column P to manually input value, else it shall perform VLOOKUP

Another advise, rather than using VLOOKUP use XLOOKUP, it gives you more flexibility.
 
Upvote 0
But the formula would still be lost if you enter something manually.
Yes @Fluff . As we know any manual entry would overwrite the column formula in that cell, be it any mode. So thought of giving him an alternate solution though it's already within his IFERROR formula.

Regards
 
Upvote 0
I don't see how that is an alternative solution, as it does not allow the OP to do what they are asking for.
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,135
Members
453,021
Latest member
Justyna P

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