#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default VBA Macro needed

Hi,
I start with the initial Ownership of Pool 1
which owns a portion of Pool 2.
I need a VBA Macro that would return the final ownership based
on the inital ownership.
Ownership must equal 1.
Initial Ownership Final Ownership
Pool 1 Owner A 0.25 Pool 1 Owner A 0.375
Pool 1 Owner B 0.25 Pool 1 Owner B 0.375
Pool 1 Owner C 0.25 Pool 1 Owner C 0.25
Pool 1 Pool 2 0.25
Pool 2 Owner A 0.5
Pool 2 Owner B 0.5

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default VBA Macro needed

Hi Jeff
I think you need to write a formula instead of VBA macro.
Final Ownership, Pool1 Owner A = His share from pool 1 + Share of pool 2
which is 0.25 multiply by his share from Pool 2.

ex. Final Ownership Pool 1 Owner A = 0.25 + 0.25*0.5 = 0.375

I hope this will help.


"Jeff" wrote:

Hi,
I start with the initial Ownership of Pool 1
which owns a portion of Pool 2.
I need a VBA Macro that would return the final ownership based
on the inital ownership.
Ownership must equal 1.
Initial Ownership Final Ownership
Pool 1 Owner A 0.25 Pool 1 Owner A 0.375
Pool 1 Owner B 0.25 Pool 1 Owner B 0.375
Pool 1 Owner C 0.25 Pool 1 Owner C 0.25
Pool 1 Pool 2 0.25
Pool 2 Owner A 0.5
Pool 2 Owner B 0.5

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default VBA Macro needed

Thank you.
What I had in mind was a inputbox to input Pool 1 then the returned values
should equal Final Ownership.

"Yara" wrote:

Hi Jeff
I think you need to write a formula instead of VBA macro.
Final Ownership, Pool1 Owner A = His share from pool 1 + Share of pool 2
which is 0.25 multiply by his share from Pool 2.

ex. Final Ownership Pool 1 Owner A = 0.25 + 0.25*0.5 = 0.375

I hope this will help.


"Jeff" wrote:

Hi,
I start with the initial Ownership of Pool 1
which owns a portion of Pool 2.
I need a VBA Macro that would return the final ownership based
on the inital ownership.
Ownership must equal 1.
Initial Ownership Final Ownership
Pool 1 Owner A 0.25 Pool 1 Owner A 0.375
Pool 1 Owner B 0.25 Pool 1 Owner B 0.375
Pool 1 Owner C 0.25 Pool 1 Owner C 0.25
Pool 1 Pool 2 0.25
Pool 2 Owner A 0.5
Pool 2 Owner B 0.5

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default VBA Macro needed

Hi Jeff
I hope this will give you a good idea:
First you have to show Developer tab on the ribbon how,
press Office button --- select Excel options
from Popular check the box show Developer tab on the ribbon

Then select the Developer tab --- select Design Mode from Controls tab
Then select Insert also from Controls tab --- select Command Button from
ActiveX group

Draw the button anywhere --- right click on the button --- select view code

VBA will be opened, write down the following starting down under Sub Private
....

Dim pool1OwnerA, pool1OwnerB, pool1OwnerC, pool1OwnerPool2 As Single
Dim pool2OwnerA, pool2OwnerB As Single
Dim ownerMESSAGE, ownerTITLE As String

ownerTITLE = "My Pool"
ownerMESSAGE = "Pool1 Enter Share of Owner A"
pool1OwnerA = InputBox(ownerMESSAGE, ownerTITLE)
ownerMESSAGE = "Pool1 Enter Share of Owner B"
pool1OwnerB = InputBox(ownerMESSAGE, ownerTITLE)
ownerMESSAGE = "Pool1 Enter Share of Owner C"
pool1OwnerC = InputBox(ownerMESSAGE, ownerTITLE)
ownerMESSAGE = "Pool1 Enter Share of Owner Pool2"
pool1OwnerPool2 = InputBox(ownerMESSAGE, ownerTITLE)
ownerMESSAGE = "Pool2 Enter Share of Owner A"
pool2OwnerA = InputBox(ownerMESSAGE, ownerTITLE)
ownerMESSAGE = "Pool2 Enter Share of Owner B"
pool2OwnerB = InputBox(ownerMESSAGE, ownerTITLE)
Worksheets("Sheet1").Cells(1, 1).Value = pool1OwnerA + pool1OwnerPool2 *
pool2OwnerA
Worksheets("Sheet1").Cells(1, 2).Value = pool1OwnerB + pool1OwnerPool2 *
pool2OwnerB
Worksheets("Sheet1").Cells(1, 3).Value = pool1OwnerC

End Sub "this line is already written"

close the editor

press again design mode button to turn it off.

Now, cross your fingers and press the button you have just created.

Well, I hope it worked.

Bye, for now, Yara

"Jeff" wrote:

Thank you.
What I had in mind was a inputbox to input Pool 1 then the returned values
should equal Final Ownership.

"Yara" wrote:

Hi Jeff
I think you need to write a formula instead of VBA macro.
Final Ownership, Pool1 Owner A = His share from pool 1 + Share of pool 2
which is 0.25 multiply by his share from Pool 2.

ex. Final Ownership Pool 1 Owner A = 0.25 + 0.25*0.5 = 0.375

I hope this will help.


"Jeff" wrote:

Hi,
I start with the initial Ownership of Pool 1
which owns a portion of Pool 2.
I need a VBA Macro that would return the final ownership based
on the inital ownership.
Ownership must equal 1.
Initial Ownership Final Ownership
Pool 1 Owner A 0.25 Pool 1 Owner A 0.375
Pool 1 Owner B 0.25 Pool 1 Owner B 0.375
Pool 1 Owner C 0.25 Pool 1 Owner C 0.25
Pool 1 Pool 2 0.25
Pool 2 Owner A 0.5
Pool 2 Owner B 0.5

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro help needed CLR Excel Discussion (Misc queries) 0 November 30th 06 03:23 PM
Macro Help needed tamato43 Excel Discussion (Misc queries) 1 August 19th 05 01:48 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"