VBA to change cells based on other cell values

Stacey_21

New Member
Joined
Jun 15, 2012
Messages
2
Hey guys,

I'm new to this so will try not to sound too stupid :p So I've got a worksheet with rows of cells, where I want a cell to do a specific vlookup on a preset range based on the values in other cells in that same row. Have been trying to do this with Target.offset as well a R1C1, and have it apply to a worksheet_change event, but can't quite get it right.... :confused:

To give an example, heres some of the table I'm working with:
Trade
Type
Work Done
Unit
Qty
Item
Total
Elec
Labour
Fix
HR
2
$50
$100
Fibre
Material
C345 Fibre
M2
1
$110
$110
Plumb
Labour
Install
HR
2
$40
$80

<tbody>
</tbody>

The rules are to go something like this: if Type is Labour, then Unit is HR and Item is a vlookup of the Trade on a range that gives the Item cost. Total is then just Item x Qty. Second part of what I'm wanting to do is if Type is Material, then the Work Done field would populate with a multi choice list of items specified in another range with corresponding Item values etc, and the same calculations take place. So in the end you can just fill out each row with everything that was done and/or purchased.

I'm thinking it shouldn't be too hard to do this but I just don't know some of the best formulas to use in the back end to make it work. Any help I can get from a guru in this would be great ;)

S.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
...anybody? Even a link to something that does similar would be great, just to help get me started.

S.
 
Upvote 0

Forum statistics

Threads
1,214,618
Messages
6,120,544
Members
448,970
Latest member
kennimack

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