Goal Seek Macro using Function() for Amazon Pricing

AYR_RAY

New Member
Joined
Dec 25, 2013
Messages
2
Hi guys

I have made a macro to calculate the sale Price on Amazon

Dim seller As Integer

seller = Range("c9")

Range("C26").GoalSeek Goal:=seller, ChangingCell:=Range("C12")

End Su
b


Where the nett amount payable to vendor is cell c9 than there are calculations which determine the Final price on Amazon is C12

works as follows

for Eg Payable to vendor is 100$


Closing Charge fixed: 10$
Freight Forwarding Charge : 70$
Commision : 8% of final rate on Amazon =16.87$
tax @ 14.5% on all these costs

so final rate will be
Final Sale rate on Amazon = 210.92$ this is calulated by goal seek

Using Goal seek and straight sets of calculations it works on a separate sheet

Now I want to convert this macro into a function which would look a figures in a n excel sheet using offset function or similar do the goal seek calculation and return the value in the cell where the formula is enetred

something like :

Function AMAZONRATE(ByVal PAYABLETOVENDOR)

GoalSeek Goal:=PAYABLETOVENDOR, ChangingCell:=Range("C12") <<<< dont know what to do
End Function


please help

thanksin advance
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
goal seek doesnt return anything but performs an operation using different ranges. It basically edits the value in the changing cell and the changing cell needs to be referenced by the formula in the range calling goalseek. It is not designed to be used in a UDF. You would need to write your own logic for goal seeking.
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,760
Members
449,095
Latest member
m_smith_solihull

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