VBA code Help

Hi, I hope someone will be able to help with my question.

I have been trying to find a VBA code but have been unsuccessfull

on the attached spreadsheet i would like thin information from 3 different cells to show in one particular cell depending on a selection that a user chooses in another cell.

this is affectively what i would like the code to do, but i have been struggling to get anything to work.

if cell B5 = TO then D3=C19
else if B5 = MSU then D3=C13
else if B5 = 2ND Stage then D3=C25

any help would be greatly appreciated

thanks

Anthony

VBA Code

Hi Anthony,

You may not need code depending on whether the cells C13, C19 & C25 contents remain the same.

If you let me know what these cells contain I'll have a look and see if a formula could work for you?

AP

VBA Code

Hi AP

Thanks for getting back to me

the 3 cells do contain different information. the idea is depending on what is selected will depend on when an item is due.

thanks anthony

Formula in D3

Formula in D3 is

=IF(B5="TO",C19,IF(B5="MSU",C13,IF(B5="2ND STAGE",C25,"")))

VBA Code

Andy,

thanks for the code.

when try it it is only bringing up a number, however for some reason the sheet is not working properly on my laptop so i will have to try it properly at work, tomorrow.

im not sure if you have looked at the sheet i attached, as the information in the 3 cells are dates, and at the moment the info in D3 is only showing a number.

but i will give it ago tomorrow and let you know how i get on

thanks for your help Andy

Hi AnthonyThe function

Hi Anthony
The function displays the contents of either C19,C25 or C13 depending on the value in B5. You may need to change the number format.