Macro formula

sloan0462

Board Regular
Joined
Feb 23, 2015
Messages
114
Hello im in need of a macro which will enter the following formula.
-(T-S)/1.8
this needs to look at the relevant row so if row 8 the formula needs to be.
-(T8-S8)/1.8
if row 9
-(T9-S9)/1.8

i need the macro to look in a certain range for whether or not a cell contains the following (Todays- shipment)
the cell that contains this will have other writing within it but it will always say (Todays- shipment) how it is shown here.

So if (Todays- shipment) is found in a cell between Q8 and Q31 i need it to enter the formula in column R for the relevant row.

to make matters more complicated if the beginning of the cell that contains (Todays- shipment) starts with the word (Time) i need the formula to be

-(T-S)/1.2

Can this be done?

Any help would be great thank you
 
Could this code be modified slightly, what i need instead of when it finds the text in O then making the formula look at that particular row for the first offset i.e. "=-(T=", i need it to look in column o for the word loop and then do the offset when it fins that. so if it finds loop in cell O9 the formula first part of the formula would b T9 making a complete formula of

=-(t9-s9)/1.2

i still need the formula to be entered in the same cell though.

Could you help, it this possible?
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,216,100
Messages
6,128,834
Members
449,471
Latest member
lachbee

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